You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/23 05:23:06 UTC

[GitHub] [incubator-superset] mistercrunch commented on a change in pull request #11382: fix: better error messages for dashboard properties modal

mistercrunch commented on a change in pull request #11382:
URL: https://github.com/apache/incubator-superset/pull/11382#discussion_r510606484



##########
File path: superset-frontend/src/dashboard/components/PropertiesModal.jsx
##########
@@ -165,13 +165,25 @@ class PropertiesModal extends React.PureComponent {
   }
 
   async handleErrorResponse(response) {
-    const { error, statusText } = await getClientErrorObject(response);
+    const { error, statusText, message } = await getClientErrorObject(response);
+    let errorText = error || statusText || t('An error has occurred');

Review comment:
       Could be good to refactor that message and similar ones in a constant:
   ```bash
   $ git grep -i "error.*occurred'" superset-frontend/
   superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx:          this.props.errorMessage || t('An error occurred'),
   superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx:          this.props.errorMessage || t('An error occurred'),
   superset-frontend/src/components/TableLoader.tsx:        props.addDangerToast(t('An error occurred'));
   superset-frontend/src/dashboard/components/PropertiesModal.jsx:      body: error || statusText || t('An error has occurred'),
   superset-frontend/src/datasource/DatasourceEditor.jsx:            error || statusText || t('An error has occurred'),
   superset-frontend/src/datasource/DatasourceModal.tsx:            body: error || t('An error has occurred'),
   superset-frontend/src/explore/components/DisplayQueryButton.jsx:            error: error || statusText || t('Sorry, An error occurred'),
   superset-frontend/src/explore/components/PropertiesModal.tsx:      body: error || statusText || t('An error has occurred'),
   superset-frontend/src/utils/getClientErrorObject.ts:            : t('An error occurred');
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org