mirror of
https://github.com/pushbits/server.git
synced 2025-05-15 18:06:59 +02:00
move errors to new package to break import cycle
This commit is contained in:
parent
5f5d941bc4
commit
dafc815be5
8 changed files with 195 additions and 20 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/pushbits/server/internal/authentication"
|
||||
"github.com/pushbits/server/internal/pberrors"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
@ -13,7 +14,7 @@ func successOrAbort(ctx *gin.Context, code int, err error) bool {
|
|||
if err != nil {
|
||||
// If we know the error force error code
|
||||
switch err {
|
||||
case ErrorMessageNotFound:
|
||||
case pberrors.ErrorMessageNotFound:
|
||||
ctx.AbortWithError(http.StatusNotFound, err)
|
||||
default:
|
||||
ctx.AbortWithError(code, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue