We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33253a6 commit 875c675Copy full SHA for 875c675
otohttp/templates/client.ts.plush
@@ -35,6 +35,9 @@ export class Client {
35
headers: headers,
36
body: JSON.stringify(<%= camelize_down(method.InputObject.TypeName) %>),
37
})
38
+ if (response.status !== 200) {
39
+ throw new Error(`<%= service.Name %>.<%= method.Name %>: ${response.status} ${response.statusText}`);
40
+ }
41
return response.json().then((json) => {
42
if (json.error) {
43
throw new Error(json.error);
0 commit comments