HandleException() 공개 정적인 메소드

MsgPack throws an exception for empty DTO's - normalizing the behavior to follow other types and return an empty instance.
public static HandleException ( Exception ex, Type type ) : object
ex System.Exception
type System.Type
리턴 object
예제 #1
0
 public override T DeserializeFromStream <T>(Stream stream)
 {
     try
     {
         return((T)WireFormat.Deserialize(typeof(T), stream));
     }
     catch (Exception ex)
     {
         return((T)WireFormat.HandleException(ex, typeof(T)));
     }
 }
예제 #2
0
 public override void SerializeToStream(IRequest requestContext, object request, Stream stream)
 {
     if (request == null)
     {
         return;
     }
     try
     {
         WireFormat.Serialize(requestContext, request, stream);
     }
     catch (Exception ex)
     {
         WireFormat.HandleException(ex, request.GetType());
     }
 }