We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ece2367 commit 4990801Copy full SHA for 4990801
1 file changed
AbeckDev.DbTimetable.Mcp/Services/TimeTableService.cs
@@ -29,13 +29,7 @@ public async Task<string> GetRecentTimetableChangesAsync(
29
request.Headers.Add("accept", "application/xml");
30
31
var response = await _httpClient.SendAsync(request, cancellationToken);
32
-
33
- if (!response.IsSuccessStatusCode)
34
- {
35
- var errorContent = await response.Content.ReadAsStringAsync(cancellationToken);
36
- throw new HttpRequestException(
37
- $"Deutsche Bahn API request failed with status {response.StatusCode}: {errorContent}");
38
- }
+ response.EnsureSuccessStatusCode();
39
40
var content = await response.Content.ReadAsStringAsync(cancellationToken);
41
return content;
0 commit comments