1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00
Files
kararas_iris/_examples/database/mysql/api/helper.go
Gerasimos (Makis) Maropoulos a8a3afea22 update dependencies
2025-08-15 23:29:20 +03:00

26 lines
543 B
Go

package api
import (
"log"
"github.com/kataras/iris/v12"
)
const debug = true
func debugf(format string, args ...any) {
if !debug {
return
}
log.Printf(format, args...)
}
func writeInternalServerError(ctx iris.Context) {
ctx.StopWithJSON(iris.StatusInternalServerError, newError(iris.StatusInternalServerError, ctx.Request().Method, ctx.Path(), ""))
}
func writeEntityNotFound(ctx iris.Context) {
ctx.StopWithJSON(iris.StatusNotFound, newError(iris.StatusNotFound, ctx.Request().Method, ctx.Path(), "entity does not exist"))
}