Procházet zdrojové kódy

change error message

WESEEK Kaito před 6 roky
rodič
revize
7895a9961d

+ 3 - 3
src/client/js/components/Admin/Users/ExternalAccountTable.jsx

@@ -24,11 +24,11 @@ class ExternalAccountTable extends React.Component {
   // remove external-account
   async removeExtenalAccount(externalAccountId) {
     try {
-      await this.props.adminExternalAccountsContainer.removeExternal(externalAccountId);
-      toastSuccess(`Removed "${this.xss.process(externalAccountId)}"`);
+      const externalAccountName = await this.props.adminExternalAccountsContainer.removeExternal(externalAccountId);
+      toastSuccess(`Removed "${this.xss.process(externalAccountName)}"`);
     }
     catch (err) {
-      toastError(new Error(`Unable to remove "${this.xss.process(externalAccountId)}"`));
+      toastError(err);
     }
   }
 

+ 1 - 4
src/server/models/external-account.js

@@ -169,10 +169,7 @@ class ExternalAccount {
       options.limit = ExternalAccount.DEFAULT_LIMIT;
     }
 
-    return this.paginate(query, options)
-      .catch((err) => {
-        debug('Error on pagination:', err);
-      });
+    return this.paginate(query, options);
   }
 
 }