Skip to content

Commit

Permalink
added response object in error
Browse files Browse the repository at this point in the history
  • Loading branch information
lsimone committed Apr 10, 2018
1 parent df919ec commit 90cd166
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares/extractData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function extractData ({options: {fullResponse}}, res) {
return fullResponse
? res : (res.data !== undefined)
? Promise.resolve(res.data) : Promise.reject({status: res.errorCode})
? Promise.resolve(res.data) : Promise.reject({status: res.errorCode, response: res})
}

0 comments on commit 90cd166

Please sign in to comment.