Browse Source

fix duplicate error message

Mike L 3 năm trước cách đây
mục cha
commit
905cd1d58d
2 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 1 1
      dist/twitter.js
  2. 1 2
      src/twitter.ts

+ 1 - 1
dist/twitter.js

@@ -407,7 +407,7 @@ class default_1 {
                 if (error instanceof instagram_private_api_1.IgExactUserNotFoundError) {
                     reply(`找不到用户 ${rawUserName.replace(/^@?(.*)$/, '@$1')}。`);
                 }
-                if (error instanceof instagram_private_api_1.IgNetworkError) {
+                else if (error instanceof instagram_private_api_1.IgNetworkError) {
                     if (error.cause.message === "Unexpected '<'") {
                         logger.warn('login required, logging in again...');
                         return this.session.login().then(retryAction);

+ 1 - 2
src/twitter.ts

@@ -281,8 +281,7 @@ export default class {
         .catch((error: IgClientError & Partial<RequestError>) => {
           if (error instanceof IgExactUserNotFoundError) {
             reply(`找不到用户 ${rawUserName.replace(/^@?(.*)$/, '@$1')}。`);
-          }
-          if (error instanceof IgNetworkError) {
+          } else if (error instanceof IgNetworkError) {
             if ((error.cause as Error).message === "Unexpected '<'") {
               logger.warn('login required, logging in again...');
               return this.session.login().then(retryAction);