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
36aec52c
Unverified
Commit
36aec52c
authored
Nov 20, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return actual error if failing to update alert data
parent
e421c387
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 additions
and
7 deletions
+1
-7
pkg/api/dashboard.go
+0
-4
pkg/api/dashboard_test.go
+0
-1
pkg/models/dashboards.go
+0
-1
pkg/services/dashboards/dashboard_service.go
+1
-1
No files found.
pkg/api/dashboard.go
View file @
36aec52c
...
@@ -277,10 +277,6 @@ func PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand) Response {
...
@@ -277,10 +277,6 @@ func PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand) Response {
return
Error
(
500
,
"Failed to save dashboard"
,
err
)
return
Error
(
500
,
"Failed to save dashboard"
,
err
)
}
}
if
err
==
m
.
ErrDashboardFailedToUpdateAlertData
{
return
Error
(
500
,
"Invalid alert data. Cannot save dashboard"
,
err
)
}
c
.
TimeRequest
(
metrics
.
M_Api_Dashboard_Save
)
c
.
TimeRequest
(
metrics
.
M_Api_Dashboard_Save
)
return
JSON
(
200
,
util
.
DynMap
{
return
JSON
(
200
,
util
.
DynMap
{
"status"
:
"success"
,
"status"
:
"success"
,
...
...
pkg/api/dashboard_test.go
View file @
36aec52c
...
@@ -727,7 +727,6 @@ func TestDashboardApiEndpoint(t *testing.T) {
...
@@ -727,7 +727,6 @@ func TestDashboardApiEndpoint(t *testing.T) {
{
SaveError
:
m
.
ErrDashboardTitleEmpty
,
ExpectedStatusCode
:
400
},
{
SaveError
:
m
.
ErrDashboardTitleEmpty
,
ExpectedStatusCode
:
400
},
{
SaveError
:
m
.
ErrDashboardFolderCannotHaveParent
,
ExpectedStatusCode
:
400
},
{
SaveError
:
m
.
ErrDashboardFolderCannotHaveParent
,
ExpectedStatusCode
:
400
},
{
SaveError
:
alerting
.
ValidationError
{
Reason
:
"Mu"
},
ExpectedStatusCode
:
422
},
{
SaveError
:
alerting
.
ValidationError
{
Reason
:
"Mu"
},
ExpectedStatusCode
:
422
},
{
SaveError
:
m
.
ErrDashboardFailedToUpdateAlertData
,
ExpectedStatusCode
:
500
},
{
SaveError
:
m
.
ErrDashboardFailedGenerateUniqueUid
,
ExpectedStatusCode
:
500
},
{
SaveError
:
m
.
ErrDashboardFailedGenerateUniqueUid
,
ExpectedStatusCode
:
500
},
{
SaveError
:
m
.
ErrDashboardTypeMismatch
,
ExpectedStatusCode
:
400
},
{
SaveError
:
m
.
ErrDashboardTypeMismatch
,
ExpectedStatusCode
:
400
},
{
SaveError
:
m
.
ErrDashboardFolderWithSameNameAsDashboard
,
ExpectedStatusCode
:
400
},
{
SaveError
:
m
.
ErrDashboardFolderWithSameNameAsDashboard
,
ExpectedStatusCode
:
400
},
...
...
pkg/models/dashboards.go
View file @
36aec52c
...
@@ -21,7 +21,6 @@ var (
...
@@ -21,7 +21,6 @@ var (
ErrDashboardVersionMismatch
=
errors
.
New
(
"The dashboard has been changed by someone else"
)
ErrDashboardVersionMismatch
=
errors
.
New
(
"The dashboard has been changed by someone else"
)
ErrDashboardTitleEmpty
=
errors
.
New
(
"Dashboard title cannot be empty"
)
ErrDashboardTitleEmpty
=
errors
.
New
(
"Dashboard title cannot be empty"
)
ErrDashboardFolderCannotHaveParent
=
errors
.
New
(
"A Dashboard Folder cannot be added to another folder"
)
ErrDashboardFolderCannotHaveParent
=
errors
.
New
(
"A Dashboard Folder cannot be added to another folder"
)
ErrDashboardFailedToUpdateAlertData
=
errors
.
New
(
"Failed to save alert data"
)
ErrDashboardsWithSameSlugExists
=
errors
.
New
(
"Multiple dashboards with the same slug exists"
)
ErrDashboardsWithSameSlugExists
=
errors
.
New
(
"Multiple dashboards with the same slug exists"
)
ErrDashboardFailedGenerateUniqueUid
=
errors
.
New
(
"Failed to generate unique dashboard id"
)
ErrDashboardFailedGenerateUniqueUid
=
errors
.
New
(
"Failed to generate unique dashboard id"
)
ErrDashboardTypeMismatch
=
errors
.
New
(
"Dashboard cannot be changed to a folder"
)
ErrDashboardTypeMismatch
=
errors
.
New
(
"Dashboard cannot be changed to a folder"
)
...
...
pkg/services/dashboards/dashboard_service.go
View file @
36aec52c
...
@@ -165,7 +165,7 @@ func (dr *dashboardServiceImpl) updateAlerting(cmd *models.SaveDashboardCommand,
...
@@ -165,7 +165,7 @@ func (dr *dashboardServiceImpl) updateAlerting(cmd *models.SaveDashboardCommand,
}
}
if
err
:=
bus
.
Dispatch
(
&
alertCmd
);
err
!=
nil
{
if
err
:=
bus
.
Dispatch
(
&
alertCmd
);
err
!=
nil
{
return
models
.
ErrDashboardFailedToUpdateAlertData
return
err
}
}
return
nil
return
nil
...
...
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