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

Commit 2cfdc33

Browse files
authored
Merge pull request #16 from uniquelyparticular/fix/formatErrorResponse
fix: improve format of errorResponse
2 parents 67809ca + 2c6d750 commit 2cfdc33

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,13 @@ const processRequest = (res, origin, url, options) => {
169169
if (response.status > 299) {
170170
// console.log('processRequest, response.statusText', response.statusText)
171171
const errorResponse = {
172-
...response,
173-
url: url,
174-
options: JSON.stringify(options),
175172
status: response.status,
176-
statusText: response.statusText
173+
statusText: response.statusText,
174+
...response,
175+
request: {
176+
url,
177+
options: JSON.stringify(options)
178+
}
177179
}
178180
return send(res, response.status || 500, errorResponse)
179181
} else {

0 commit comments

Comments
 (0)