Skip to content

Commit

Permalink
[TypeScriptAngular2Client] fixed unnecessary thrown unhandled excepti…
Browse files Browse the repository at this point in the history
…ons with non 204 (http status code) but empty http responses. swagger-api#1334
  • Loading branch information
iain17 committed May 17, 2017
1 parent 999e2a5 commit 36774e8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export class {{classname}} {
.map((response: Response) => {
if (response.status === 204) {
return undefined;
} else {
}
try {
return response.json() || {};
}catch(e){
return {};
}
});
}
Expand Down

0 comments on commit 36774e8

Please sign in to comment.