示例#1
0
 public static string GetMessage(BenderException exception, INode source, INode target, Mode mode)
 {
     return((mode == Mode.Deserialize ?
             DeserializationMessageFormat.ToFormat(source.Format, source.Type, source.Path, target.Path) :
             SerializationMessageFormat.ToFormat(source.Path, target.Format, target.Type, target.Path)) +
            exception.Message);
 }
示例#2
0
 private bool HandleExceptions(BenderException exception, TSource source, TTarget target, Mode mode)
 {
     if (exception is MappingException || exception is FriendlyMappingException)
     {
         return(false);
     }
     if (exception is FriendlyBenderException)
     {
         throw new FriendlyMappingException(
                   exception.As <FriendlyBenderException>(), source, target, mode);
     }
     throw new MappingException(exception, source, target, mode);
 }
示例#3
0
 public MappingException(BenderException exception, INode source, INode target, Mode mode) :
     base(exception, GetMessage(exception, source, target, mode))
 {
 }