This commit is contained in:
madaoxs
2026-01-13 17:55:36 +08:00
commit e348e845f2
14 changed files with 700 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package apperror
import "github.com/gofiber/fiber/v2"
type AppError struct {
Status int
Message string
}
func (e *AppError) Error() string {
return e.Message
}
func BadRequest(message string) *AppError {
return &AppError{Status: fiber.StatusBadRequest, Message: message}
}
func Internal(message string) *AppError {
return &AppError{Status: fiber.StatusInternalServerError, Message: message}
}