Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Handle 'user_not_found' error
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Apr 28, 2020
1 parent 1e73679 commit 011e2a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/service/slack/slack-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,14 @@ class SlackAccount extends Account {
member.is_bot = true
member.profile = member.icons
} else {
const {user} = await this.rtm.webClient.users.info({user: id})
member = user
try {
const {user} = await this.rtm.webClient.users.info({user: id})
member = user
} catch (e) {
if (e.data && e.data.error === 'user_not_found')
return this.saveUser({id, name: 'Unknown'})
throw e
}
}
return this.saveUser(member)
}
Expand Down

0 comments on commit 011e2a9

Please sign in to comment.