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); }
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); }
public MappingException(BenderException exception, INode source, INode target, Mode mode) : base(exception, GetMessage(exception, source, target, mode)) { }