Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: timeout error message #10478

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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