diff --git a/workbench/public/components/Main/main.tsx b/workbench/public/components/Main/main.tsx index e0d438f460..3646f0bf7d 100644 --- a/workbench/public/components/Main/main.tsx +++ b/workbench/public/components/Main/main.tsx @@ -249,15 +249,6 @@ export class Main extends React.Component { }; } - formatQueryErrorBody(data: any) { - let prettyErrorMessage = ""; - prettyErrorMessage += 'reason: ' + data.errorReason + '\n'; - prettyErrorMessage += 'details: ' + data.errorDetails + '\n'; - prettyErrorMessage += 'type: ' + data.errorType + '\n'; - prettyErrorMessage += 'status: ' + data.status; - return prettyErrorMessage; - } - processQueryResponse(response: IHttpResponse): ResponseDetail { if (!response) { return { @@ -270,7 +261,7 @@ export class Main extends React.Component { return { fulfilled: false, errorMessage: response.data.resp, - data: this.formatQueryErrorBody(response.data), + data: response.data.body, }; } diff --git a/workbench/public/components/PPLPage/PPLPage.tsx b/workbench/public/components/PPLPage/PPLPage.tsx index 7a59a6d2e8..cc1c948edf 100644 --- a/workbench/public/components/PPLPage/PPLPage.tsx +++ b/workbench/public/components/PPLPage/PPLPage.tsx @@ -76,15 +76,9 @@ export class PPLPage extends React.Component { return false; } - const showExplainErrorMessage = () => { - return this.props.pplTranslations.map((queryTranslation: any) => JSON.stringify( - queryTranslation.errorMessage + ": This query is not explainable.", null, 2 - )); - } - const explainContent = pplTranslationsNotEmpty() ? this.props.pplTranslations.map((queryTranslation: any) => JSON.stringify(queryTranslation.data, null, 2)).join("\n") - : showExplainErrorMessage(); + : 'This query is not explainable.'; let modal; diff --git a/workbench/public/components/SQLPage/SQLPage.tsx b/workbench/public/components/SQLPage/SQLPage.tsx index e2c3e1d92f..f808bff4e9 100644 --- a/workbench/public/components/SQLPage/SQLPage.tsx +++ b/workbench/public/components/SQLPage/SQLPage.tsx @@ -79,15 +79,9 @@ export class SQLPage extends React.Component { return false; } - const showExplainErrorMessage = () => { - return this.props.sqlTranslations.map((queryTranslation: any) => JSON.stringify( - queryTranslation.errorMessage + ": This query is not explainable.", null, 2 - )); - } - const explainContent = sqlTranslationsNotEmpty() ? this.props.sqlTranslations.map((queryTranslation: any) => JSON.stringify(queryTranslation.data, null, 2)).join("\n") - : showExplainErrorMessage(); + : 'This query is not explainable.'; let modal; diff --git a/workbench/server/services/QueryService.ts b/workbench/server/services/QueryService.ts index ede6c9dfde..9ad1a2790f 100644 --- a/workbench/server/services/QueryService.ts +++ b/workbench/server/services/QueryService.ts @@ -41,15 +41,11 @@ export default class QueryService { }; } catch (err) { console.log(err); - const errorObj = JSON.parse(err.body); return { data: { ok: false, resp: err.message, - errorReason: errorObj.error.reason, - errorDetails: errorObj.error.details, - errorType: errorObj.error.type, - status: errorObj.status + body: err.body }, }; }