Skip to content

Commit

Permalink
Use more fitting exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
lyarenei committed Feb 23, 2024
1 parent c4dad3f commit 9141385
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Jellyfin.Plugin.ListenBrainz.MusicBrainzApi/BaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private async Task<TResponse> DoRequest<TResponse>(HttpRequestMessage requestMes
var result = await JsonSerializer.DeserializeAsync<TResponse>(responseStream, SerializerOptions, cancellationToken);
if (result is null)
{
throw new InvalidResponseException("Response deserialized to NULL");
throw new NoDataException("Response deserialized to NULL");
}

return result;
Expand Down Expand Up @@ -197,7 +197,7 @@ private async Task<HttpResponseMessage> DoRequestWithRetry(HttpRequestMessage re
return response;
}

throw new NoDataException("No response available from MusicBrainz server");
throw new InvalidResponseException("No response available from MusicBrainz server");
}

private async Task HandleRateLimit()
Expand Down

0 comments on commit 9141385

Please sign in to comment.