Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Avoid calling the cb twice when statusCode > 400 #218

Merged
merged 1 commit into from
Feb 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/request-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function onRes (buffer, cb) {
if (res.statusCode >= 400 || !res.statusCode) {
const error = new Error(`Server responded with ${res.statusCode}`)

Wreck.read(res, {json: true}, (err, payload) => {
return Wreck.read(res, {json: true}, (err, payload) => {
if (err) {
return cb(err)
}
Expand Down