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
1940b33d
Commit
1940b33d
authored
Jul 04, 2017
by
Jesse White
Committed by
Daniel Lee
Jul 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: handling of http errors without any data (#8777)
parent
d20455ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletions
+34
-1
public/app/core/services/backend_srv.ts
+1
-1
public/test/specs/backend_srv-specs.js
+33
-0
No files found.
public/app/core/services/backend_srv.ts
View file @
1940b33d
...
...
@@ -179,7 +179,7 @@ export class BackendSrv {
}
// for Prometheus
if
(
!
err
.
data
.
message
&&
_
.
isString
(
err
.
data
.
error
))
{
if
(
err
.
data
&&
!
err
.
data
.
message
&&
_
.
isString
(
err
.
data
.
error
))
{
err
.
data
.
message
=
err
.
data
.
error
;
}
...
...
public/test/specs/backend_srv-specs.js
0 → 100644
View file @
1940b33d
define
([
'app/core/config'
,
'app/core/services/backend_srv'
],
function
()
{
'use strict'
;
describe
(
'backend_srv'
,
function
()
{
var
_backendSrv
;
var
_http
;
var
_httpBackend
;
beforeEach
(
module
(
'grafana.core'
));
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
inject
(
function
(
$httpBackend
,
$http
,
backendSrv
)
{
_httpBackend
=
$httpBackend
;
_http
=
$http
;
_backendSrv
=
backendSrv
;
}));
describe
(
'when handling errors'
,
function
()
{
it
(
'should return the http status code'
,
function
(
done
)
{
_httpBackend
.
whenGET
(
'gateway-error'
).
respond
(
502
);
_backendSrv
.
datasourceRequest
({
url
:
'gateway-error'
}).
catch
(
function
(
err
)
{
expect
(
err
.
status
).
to
.
be
(
502
);
done
();
});
_httpBackend
.
flush
();
});
});
});
});
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