Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.
Open
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
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ module.exports = function ( app, options ) {
uri: webmakerUrl + "user/" + id,
json: true
}, function ( error, response, body ) {
// User account wasn't found. Treat differently
if ( response.statusCode === 404 ) {
return callback();
}

// Shallow error check
if ( error ) {
return callback( error );
}

// User account wasn't found. Treat differently
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this below the // Deep error check code block and test it?

if ( response.statusCode === 404 ) {
return callback();
}

// Deep error check
if ( body && body.error ) {
return callback( body.error );
Expand Down