add response error handling for retrieveUnreadMessages
This commit is contained in:
parent
adc253045b
commit
044674d8d6
1 changed files with 4 additions and 0 deletions
4
app.js
4
app.js
|
@ -115,6 +115,10 @@ const retrieveUnreadMessages = (accessToken, callback) => {
|
|||
return callback(e, null);
|
||||
}
|
||||
|
||||
if (response.error) {
|
||||
return callback(new Error(response.message));
|
||||
}
|
||||
|
||||
return callback(null, response.data.children);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue