flickr/slurp: Treat fail as an error (#2544)

Reject the promise when we get a fail status.
This commit is contained in:
Erik Arvidsson
2016-09-12 13:57:33 -07:00
committed by GitHub
parent 0b2eb226bc
commit d9ebf6ac90

View File

@@ -156,7 +156,11 @@ function callFlickr(method: string, params: ?{[key: string]: string}) {
if (err) {
rej(err);
} else {
res(data);
if (data.stat === 'fail') {
rej(new Error(data.message));
} else {
res(data);
}
}
},
});