Skip to content

Commit

Permalink
fix: timeout error message (#10478)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Ritter authored Jul 29, 2020
1 parent 259a344 commit 1fbd920
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
35 changes: 25 additions & 10 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@superset-ui/chart-composition": "^0.14.9",
"@superset-ui/chart-controls": "^0.14.9",
"@superset-ui/color": "^0.14.9",
"@superset-ui/connection": "^0.14.9",
"@superset-ui/connection": "^0.14.19",
"@superset-ui/core": "^0.14.9",
"@superset-ui/dimension": "^0.14.9",
"@superset-ui/legacy-plugin-chart-calendar": "^0.14.9",
Expand Down
7 changes: 4 additions & 3 deletions superset-frontend/src/utils/getClientErrorObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type ClientErrorObject = {
} & Partial<SupersetClientResponse>;

export default function getClientErrorObject(
response: SupersetClientResponse | string,
response: SupersetClientResponse | (Response & { timeout: number }) | string,
): Promise<ClientErrorObject> {
// takes a SupersetClientResponse as input, attempts to read response as Json if possible,
// and returns a Promise that resolves to a plain object with error key and text value.
Expand Down Expand Up @@ -89,7 +89,8 @@ export default function getClientErrorObject(
});
} else if (
'statusText' in response &&
response.statusText === 'timeout'
response.statusText === 'timeout' &&
'timeout' in response
) {
resolve({
...responseObject,
Expand All @@ -98,7 +99,7 @@ export default function getClientErrorObject(
{
error_type: ErrorTypeEnum.FRONTEND_TIMEOUT_ERROR,
extra: {
timeout: 1,
timeout: response.timeout / 1000,
issue_codes: [
{
code: 1000,
Expand Down

0 comments on commit 1fbd920

Please sign in to comment.