mirror of
https://github.com/pushbits/server.git
synced 2025-05-12 16:37:02 +02:00
get delete messages to work
This commit is contained in:
parent
b392ea1b44
commit
eebc7f7e31
7 changed files with 103 additions and 18 deletions
|
@ -11,7 +11,13 @@ import (
|
|||
|
||||
func successOrAbort(ctx *gin.Context, code int, err error) bool {
|
||||
if err != nil {
|
||||
ctx.AbortWithError(code, err)
|
||||
// If we know the error force error code
|
||||
switch err {
|
||||
case ErrorMessageNotFound:
|
||||
ctx.AbortWithError(http.StatusNotFound, err)
|
||||
default:
|
||||
ctx.AbortWithError(code, err)
|
||||
}
|
||||
}
|
||||
|
||||
return err == nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue