Skip to content

Commit

Permalink
Fix: Avoid NREs if no title is found for a dump.
Browse files Browse the repository at this point in the history
  • Loading branch information
fearnlj01 committed Nov 12, 2024
1 parent 0dc2457 commit baac0b3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Apis/ShokoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,23 @@ public async Task<AniDBSearchResult> MatchTitle(string filename)
ex is HttpRequestException or JsonException or ArgumentNullException or InvalidOperationException
)
{
Logger.Warn(CultureInfo.InvariantCulture, "Unable to retrieve title information for a file (fileName='{filename}') from AniDB", filename);
Logger.Warn(CultureInfo.InvariantCulture,
"Unable to retrieve title information for a file (fileName='{filename}') from AniDB", filename);
Logger.Debug("Exception: {ex}", ex);
return null;
return new AniDBSearchResult()
{
Total = 0,
List = []
};
}
catch (Exception)
{
// I don't want to be the cause for more NREs... I'm playing it safe this time round.
return new AniDBSearchResult()
{
Total = 0,
List = []
};
}
}

Expand Down

0 comments on commit baac0b3

Please sign in to comment.