Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
29a50546
Commit
29a50546
authored
8 years ago
by
Lewis Liu
Browse files
Options
Downloads
Patches
Plain Diff
Added error handling for dashboard cards
parent
8f448d28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/dashboard/dashboard.js
+17
-1
17 additions, 1 deletion
frontend/src/metabase/dashboard/dashboard.js
with
17 additions
and
1 deletion
frontend/src/metabase/dashboard/dashboard.js
+
17
−
1
View file @
29a50546
...
...
@@ -152,7 +152,23 @@ export const fetchCardData = createThunkAction(FETCH_CARD_DATA, function(card, d
}
},
DATASET_SLOW_TIMEOUT
);
result
=
await
MetabaseApi
.
dataset
(
datasetQuery
);
try
{
// result = await MetabaseApi.dataset(datasetQuery);
// mocking an angular $http response 504 object
// not sure if this is the exact shape and content, but hopefully close enough
result
=
await
Promise
.
reject
({
status
:
504
,
statusText
:
"
GATEWAY_TIMEOUT
"
,
data
:
{
message
:
"
Failed to load resource: the server responded with a status of 504 (GATEWAY_TIMEOUT)
"
}
});
}
catch
(
error
)
{
clearTimeout
(
slowCardTimer
);
return
{
dashcard_id
:
dashcard
.
id
,
card_id
:
card
.
id
,
result
:
{
error
}
};
}
clearTimeout
(
slowCardTimer
);
return
{
dashcard_id
:
dashcard
.
id
,
card_id
:
card
.
id
,
result
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment