Include response body in API error messages

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-01-17 01:18:06 +00:00
parent 6cf147989f
commit 51749ad811

View File

@@ -50,7 +50,8 @@ export class DefaultWeatherKitClient implements WeatherKitClient {
})
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()