Skip to content

Commit

Permalink
fix: remove inaccessible account
Browse files Browse the repository at this point in the history
  • Loading branch information
AVVS committed Mar 11, 2019
1 parent 60f7f3e commit c3a3185
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,11 @@ class Twitter {
try {
await this.syncAccount(twAccount.account, 'desc');
} catch (exception) {
const isAccountInaccessible = exception.statusCode === 401
|| (Array.isArray(exception) && exception.find(it => (it.code === 34)));

// removed twitter account
if (Array.isArray(exception) && exception.find(it => (it.code === 34))) {
if (isAccountInaccessible) {
this.logger.warn('removing tw %j from database', twAccount);
await this.storage.feeds().remove({
internal: twAccount.internal,
Expand Down

0 comments on commit c3a3185

Please sign in to comment.