Skip to content

Commit

Permalink
Return error if internal error occurs (#301)
Browse files Browse the repository at this point in the history
* fix cases of not returning error through InternalError
  • Loading branch information
Max Siegieda authored Nov 8, 2018
1 parent d193c3c commit b8f02dc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion handlers/api/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (b Build) CreateEvent(c *gin.Context) {
}

if err != nil {
sugar.InternalError(c, nil)
sugar.InternalError(c, err)
return
}
eventMessage := "Build entered state:" + event.Status
Expand Down
2 changes: 1 addition & 1 deletion handlers/api/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (d Deployment) CreateEvent(c *gin.Context) {
newEvent, err := d.AddEvent(c, dep, event)

if err != nil {
sugar.InternalError(c, nil)
sugar.InternalError(c, err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion handlers/api/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (g Graph) CreateEvent(c *gin.Context) {
newEvent, err := BatchService{AWS: g.AWS}.AddEvent(&graph.BatchJob, event)

if err != nil {
sugar.InternalError(c, nil)
sugar.InternalError(c, err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion handlers/api/simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (s Simulation) CreateEvent(c *gin.Context) {
newEvent, err := BatchService{AWS: s.AWS}.AddEvent(&sim.BatchJob, event)

if err != nil {
sugar.InternalError(c, nil)
sugar.InternalError(c, err)
return
}

Expand Down

0 comments on commit b8f02dc

Please sign in to comment.