mirror of
https://github.com/kennethnym/aris.git
synced 2026-02-02 21:21:21 +00:00
Include response body in API error messages
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -50,7 +50,8 @@ export class DefaultWeatherKitClient implements WeatherKitClient {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`WeatherKit API error: ${response.status} ${response.statusText}`)
|
const body = await response.text()
|
||||||
|
throw new Error(`WeatherKit API error: ${response.status} ${response.statusText}: ${body}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user