Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from uniquelyparticular/fix/formatErrorResponse
Browse files Browse the repository at this point in the history
fix: improve format of errorResponse
  • Loading branch information
agrohs authored May 29, 2019
2 parents 67809ca + 2c6d750 commit 2cfdc33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ const processRequest = (res, origin, url, options) => {
if (response.status > 299) {
// console.log('processRequest, response.statusText', response.statusText)
const errorResponse = {
...response,
url: url,
options: JSON.stringify(options),
status: response.status,
statusText: response.statusText
statusText: response.statusText,
...response,
request: {
url,
options: JSON.stringify(options)
}
}
return send(res, response.status || 500, errorResponse)
} else {
Expand Down

0 comments on commit 2cfdc33

Please sign in to comment.