Skip to content

Commit 4990801

Browse files
abeckDevCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ece2367 commit 4990801

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

AbeckDev.DbTimetable.Mcp/Services/TimeTableService.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ public async Task<string> GetRecentTimetableChangesAsync(
2929
request.Headers.Add("accept", "application/xml");
3030

3131
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-
}
32+
response.EnsureSuccessStatusCode();
3933

4034
var content = await response.Content.ReadAsStringAsync(cancellationToken);
4135
return content;

0 commit comments

Comments
 (0)