mirror of
https://github.com/khairul169/vaulterm.git
synced 2025-06-18 01:29:37 +07:00
15 lines
252 B
Go
15 lines
252 B
Go
|
package utils
|
||
|
|
||
|
import "github.com/gofiber/fiber/v2"
|
||
|
|
||
|
func ResponseError(c *fiber.Ctx, err error, status int) error {
|
||
|
if status == 0 {
|
||
|
status = fiber.StatusInternalServerError
|
||
|
}
|
||
|
|
||
|
return &fiber.Error{
|
||
|
Code: status,
|
||
|
Message: err.Error(),
|
||
|
}
|
||
|
}
|