Commit 5d733b9
authored
[javascript] Fix thrown error message when API status code is unknown (#1160)
## Motivation
The response body was not read correctly, causing the SDK to throw
errors like `Message: "Unknown API Status Code! Body: "[object
Object]"`. This happens when the API returns an unexpected status code
(like 500) or when the content type is not defined.
## Solution
Using `await response.body.text()` should return the actual response
body.1 parent 364ba3e commit 5d733b9
1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
| |||
214 | 219 | | |
215 | 220 | | |
216 | 221 | | |
217 | | - | |
218 | | - | |
| 222 | + | |
| 223 | + | |
219 | 224 | | |
220 | 225 | | |
221 | 226 | | |
| |||
0 commit comments