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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to