Skip to content

Commit

Permalink
Merge pull request #20 from mailosaur/promise-reject
Browse files Browse the repository at this point in the history
Add missing promise rejection
  • Loading branch information
jm-mailosaur authored Aug 12, 2019
2 parents 5051a31 + fd61c23 commit 9a82977
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/operations/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ class Messages {
}

if (!optionalCallback) {
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
self.search(server, criteria, options).then((result) => {
return self.getById(result.items[0].id);
}).then((message) => {
resolve(message);
});
}).catch(reject);
});
} else {
self.search(server, criteria, options).then((result) => {
Expand Down

0 comments on commit 9a82977

Please sign in to comment.