Created
August 28, 2015 08:04
-
-
Save Hanspagh/9cd5e32f4d5c0c4ec644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseError(response) { | |
return Promise.try(function() { | |
if(!response || !response.body) { | |
return new Error('Request failed'); | |
} | |
if(response.body.homes.length > 1) { | |
return new Error('Too many real estates found'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment