Skip to content

Commit 79088eb

Browse files
committed
on refreshToken fail catch with arrow function
1 parent e296e12 commit 79088eb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/triggers/contacts.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,9 @@ function processAction(msg, cfg, snapshot) {
2727

2828
const instance = new ApiClient(cfg, self);
2929

30-
function emitError(message) {
31-
this.emit('error', new Error(message));
32-
}
33-
34-
const refreshTokenError = 'Failed to refresh token';
3530
const newAccessToken
3631
= yield instance.getRefreshedToken()
37-
.catch(emitError.bind(self, refreshTokenError));
32+
.catch(() => this.emit('error', new Error('Failed to refresh token')));
3833

3934
if (!newAccessToken) {
4035
return;

0 commit comments

Comments
 (0)