Skip to content

Commit

Permalink
Merge pull request #30 from Authress/wparad/handle-empty-bodies
Browse files Browse the repository at this point in the history
Handle empty bodies.
  • Loading branch information
wparad authored Dec 14, 2023
2 parents 46c9290 + cd0d1c6 commit a915467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/httpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class HttpClient {
url,
headers: response.headers,
status: response.status,
data: await response.json()
data: await response.json().catch(e => e) || {}
};
} catch (error) {
const resolvedError = typeof error.json === 'function' ? await error.json().catch(e => e) : error;
Expand Down

0 comments on commit a915467

Please sign in to comment.