public PageReadResult(Uri uri, List <ScrapedSong> songs, Exception exception, PageErrorType pageError) : this(uri, songs) { if (exception != null) { if (pageError == PageErrorType.None) { pageError = PageErrorType.Unknown; } PageError = pageError; if (exception is FeedReaderException frException) { Exception = frException; } else { Exception = new FeedReaderException(exception.Message, exception); } } else { if (pageError > PageError) { PageError = pageError; } } }
public PageReadResult(Uri uri, List <ScrapedSong>?songs, ScrapedSong?firstSong, ScrapedSong?lastSong, int songsOnPage, Exception?exception, PageErrorType pageError, bool isLastPage = false) : this(uri, songs, firstSong, lastSong, songsOnPage, isLastPage) { if (exception != null) { if (pageError == PageErrorType.None) { pageError = PageErrorType.Unknown; } PageError = pageError; if (exception is FeedReaderException frException) { Exception = frException; } else { Exception = new FeedReaderException(exception.Message, exception); } } else { if (pageError > PageError) { PageError = pageError; } } }
public FeedResult(Dictionary <string, ScrapedSong> songs, IList <PageReadResult> pageResults, Exception exception, FeedResultError errorLevel) : this(songs, pageResults) { if (ErrorCode < errorLevel) { ErrorCode = errorLevel; } if (exception != null) { if (exception is FeedReaderException frException) { Exception = frException; } else if (exception is OperationCanceledException canceledException) { ErrorCode = FeedResultError.Cancelled; Exception = new FeedReaderException(canceledException.Message, canceledException, FeedReaderFailureCode.Cancelled); } else { Exception = new FeedReaderException(exception.Message, exception); } } }