add http error handling

This commit is contained in:
Emil Lerch 2021-06-12 13:38:50 -07:00
parent 78478ab470
commit 01aa8c8d1a
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -61,6 +61,11 @@ pub const Aws = struct {
},
);
defer response.deinit();
if (response.response_code != 200) {
log.err("call failed! return status: {d}", .{response.response_code});
log.err("{s}", .{response.body});
return error.HttpFailure;
}
// TODO: Check status code for badness
var stream = json.TokenStream.init(response.body);