Skip to content

Instantly share code, notes, and snippets.

@Hanspagh
Created August 28, 2015 08:04
Show Gist options
  • Save Hanspagh/9cd5e32f4d5c0c4ec644 to your computer and use it in GitHub Desktop.
Save Hanspagh/9cd5e32f4d5c0c4ec644 to your computer and use it in GitHub Desktop.
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