mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-24 09:33:42 -04:00
Fix API error handling to correctly parse error details
This commit is contained in:
@@ -50,7 +50,8 @@ export async function typedAPICall<P extends APIPath>(
|
||||
}
|
||||
|
||||
if (!resp.ok) {
|
||||
throw new APIError(resp.status as any, json?.error?.message, json?.error?.details)
|
||||
json = json?.error ?? json
|
||||
throw new APIError(resp.status as any, json?.message, json?.details)
|
||||
}
|
||||
return json
|
||||
}) as APIResponse<P>
|
||||
|
||||
Reference in New Issue
Block a user