mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
25 lines
424 B
Go
25 lines
424 B
Go
package mock
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"runtime/debug"
|
|
)
|
|
|
|
func HandleError(statusCode int, c *gin.Context, err error) {
|
|
debug.PrintStack()
|
|
c.JSON(statusCode, Response{
|
|
Status: "ok",
|
|
Message: "error",
|
|
Error: err.Error(),
|
|
})
|
|
}
|
|
|
|
func HandleErrorF(statusCode int, c *gin.Context, err string) {
|
|
debug.PrintStack()
|
|
c.JSON(statusCode, Response{
|
|
Status: "ok",
|
|
Message: "error",
|
|
Error: err,
|
|
})
|
|
}
|