mirror of
https://github.com/veops/oneterm.git
synced 2025-10-06 07:47:12 +08:00
feat(backend): errors move to pkg
This commit is contained in:
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
|
||||
"github.com/veops/oneterm/internal/api/controller"
|
||||
myi18n "github.com/veops/oneterm/internal/i18n"
|
||||
"github.com/veops/oneterm/pkg/errors"
|
||||
)
|
||||
|
||||
type bodyWriter struct {
|
||||
@@ -47,7 +47,7 @@ func Error2RespMiddleware() gin.HandlerFunc {
|
||||
e := ctx.Errors.Last().Err
|
||||
obj["message"] = e.Error()
|
||||
|
||||
ae, ok := e.(*controller.ApiError)
|
||||
ae, ok := e.(*errors.ApiError)
|
||||
if ok {
|
||||
lang := ctx.PostForm("lang")
|
||||
accept := ctx.GetHeader("Accept-Language")
|
||||
|
Reference in New Issue
Block a user