Update error reporting middleware

This commit is contained in:
Dane Everitt
2020-12-15 21:08:00 -08:00
parent 3a26a5d39d
commit 0ecc166dcd
9 changed files with 100 additions and 114 deletions

View File

@@ -34,7 +34,7 @@ func postServerBackup(c *gin.Context) {
}
if err != nil {
TrackedServerError(err, s).Abort(c)
NewServerError(err, s).Abort(c)
return
}
@@ -63,7 +63,7 @@ func deleteServerBackup(c *gin.Context) {
return
}
TrackedServerError(err, s).Abort(c)
NewServerError(err, s).Abort(c)
return
}
@@ -72,7 +72,7 @@ func deleteServerBackup(c *gin.Context) {
// the backup previously and it is now missing when we go to delete, just treat it as having
// been successful, rather than returning a 404.
if !errors.Is(err, os.ErrNotExist) {
TrackedServerError(err, s).Abort(c)
NewServerError(err, s).Abort(c)
return
}
}