Skip to content

Commit

Permalink
return bad request when deleting the storage
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchiu committed Aug 28, 2018
1 parent 5fa4efa commit 052245d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/handler_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ func deleteStorage(ctx *web.Context) {
}

if err := storageProvider.DeleteStorage(sp, &storage); err != nil {
response.InternalServerError(req.Request, resp.ResponseWriter, err)
if err, ok := err.(*areaError); ok {
response.InternalServerError(req.Request, resp.ResponseWriter, err)
} else {
response.BadRequest(req.Request, resp.ResponseWriter, err)
}
return
}

Expand Down

0 comments on commit 052245d

Please sign in to comment.