Commit 199ab99
committed
fix(googlechat): throw on non-ok response instead of parsing error body as success
When the Google Chat API returns 4xx/5xx with a JSON error body,
response.json() parses the error as the success type T, hiding
the HTTP status code and error message. The caller sees a
type-valid success response where expected fields are undefined.
Add response.ok check before response.json() so HTTP errors throw
with status code and response body. Export readGoogleChatJsonResponse
for reuse.1 parent 52a02f7 commit 199ab99
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments