Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5e276542
Unverified
Commit
5e276542
authored
Aug 27, 2020
by
Torkel Ödegaard
Committed by
GitHub
Aug 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dashboard: Ignore cancelled api request error when loading dashboard (#27232)
parent
1e8b10ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
public/app/features/dashboard/state/initDashboard.test.ts
+1
-1
public/app/features/dashboard/state/initDashboard.ts
+5
-5
No files found.
public/app/features/dashboard/state/initDashboard.test.ts
View file @
5e276542
...
...
@@ -214,7 +214,7 @@ describeInitScenario('Initializing home dashboard', ctx => {
describeInitScenario
(
'Initializing home dashboard cancelled'
,
ctx
=>
{
ctx
.
setup
(()
=>
{
ctx
.
args
.
routeInfo
=
DashboardRouteInfo
.
Home
;
ctx
.
backendSrv
.
get
.
mockRe
solvedValue
([]
);
ctx
.
backendSrv
.
get
.
mockRe
jectedValue
({
cancelled
:
true
}
);
});
it
(
'Should abort init process'
,
()
=>
{
...
...
public/app/features/dashboard/state/initDashboard.ts
View file @
5e276542
...
...
@@ -68,11 +68,6 @@ async function fetchDashboard(
// load home dash
const
dashDTO
:
DashboardDTO
=
await
backendSrv
.
get
(
'/api/dashboards/home'
);
// if above all is cancelled it will return an array
if
(
Array
.
isArray
(
dashDTO
))
{
return
null
;
}
// if user specified a custom home dashboard redirect to that
if
(
dashDTO
.
redirectUri
)
{
const
newUrl
=
locationUtil
.
stripBaseFromUrl
(
dashDTO
.
redirectUri
);
...
...
@@ -116,6 +111,11 @@ async function fetchDashboard(
throw
{
message
:
'Unknown route '
+
args
.
routeInfo
};
}
}
catch
(
err
)
{
// Ignore cancelled errors
if
(
err
.
cancelled
)
{
return
null
;
}
dispatch
(
dashboardInitFailed
({
message
:
'Failed to fetch dashboard'
,
error
:
err
}));
console
.
error
(
err
);
return
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment