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
f4cd9bc7
Commit
f4cd9bc7
authored
Apr 17, 2019
by
Ryan McKinley
Committed by
Torkel Ödegaard
Apr 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PanelQueryRunner: move error handling to QueryRunnerOptions (#16654)
parent
ed019210
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
public/app/features/dashboard/dashgrid/PanelChrome.tsx
+3
-9
public/app/features/dashboard/state/PanelQueryRunner.ts
+14
-4
No files found.
public/app/features/dashboard/dashgrid/PanelChrome.tsx
View file @
f4cd9bc7
...
...
@@ -99,15 +99,9 @@ export class PanelChrome extends PureComponent<Props, State> {
if
(
data
.
state
===
LoadingState
.
Error
)
{
const
{
error
}
=
data
;
if
(
error
)
{
let
message
=
'Query error'
;
if
(
error
.
message
)
{
message
=
error
.
message
;
}
else
if
(
error
.
data
&&
error
.
data
.
message
)
{
message
=
error
.
data
.
message
;
}
else
if
(
error
.
data
&&
error
.
data
.
error
)
{
message
=
error
.
data
.
error
;
}
else
if
(
error
.
status
)
{
message
=
`Query error:
${
error
.
status
}
${
error
.
statusText
}
`
;
let
message
=
error
.
message
;
if
(
!
message
)
{
message
=
'Query error'
;
}
if
(
this
.
state
.
errorMessage
!==
message
)
{
...
...
public/app/features/dashboard/state/PanelQueryRunner.ts
View file @
f4cd9bc7
...
...
@@ -20,10 +20,10 @@ import cloneDeep from 'lodash/cloneDeep';
import
kbn
from
'app/core/utils/kbn'
;
export
interface
QueryRunnerOptions
{
ds
?:
DataSourceApi
;
// if they already have the datasource, don't look it up
export
interface
QueryRunnerOptions
<
TQuery
extends
DataQuery
=
DataQuery
>
{
ds
?:
DataSourceApi
<
TQuery
>
;
// if they already have the datasource, don't look it up
datasource
:
string
|
null
;
queries
:
Data
Query
[];
queries
:
T
Query
[];
panelId
:
number
;
dashboardId
?:
number
;
timezone
?:
string
;
...
...
@@ -174,7 +174,17 @@ export class PanelQueryRunner {
}
catch
(
err
)
{
const
error
=
err
as
DataQueryError
;
if
(
!
error
.
message
)
{
err
.
message
=
'Query Error'
;
let
message
=
'Query error'
;
if
(
error
.
message
)
{
message
=
error
.
message
;
}
else
if
(
error
.
data
&&
error
.
data
.
message
)
{
message
=
error
.
data
.
message
;
}
else
if
(
error
.
data
&&
error
.
data
.
error
)
{
message
=
error
.
data
.
error
;
}
else
if
(
error
.
status
)
{
message
=
`Query error:
${
error
.
status
}
${
error
.
statusText
}
`
;
}
error
.
message
=
message
;
}
this
.
data
=
{
...
...
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