WatchDog Kube
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
func HandleControllerErrors(c beego.Controller, code int, err *error, data *map[string]interface{}, messages ...string) {
|
||||
for _, mess := range messages {
|
||||
fmt.Println(mess)
|
||||
}
|
||||
if data != nil {
|
||||
c.Data["json"] = data
|
||||
}
|
||||
if err != nil {
|
||||
c.Data["json"] = map[string]string{"error": (*err).Error()}
|
||||
}
|
||||
c.Ctx.Output.SetStatus(code)
|
||||
c.ServeJSON()
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"oc-datacenter/conf"
|
||||
"strconv"
|
||||
|
||||
@@ -41,7 +40,6 @@ func (o *SessionController) GetToken() {
|
||||
o.ServeJSON()
|
||||
return
|
||||
}
|
||||
fmt.Println("BLAPO", id, duration)
|
||||
token, err := serv.GenerateToken(o.Ctx.Request.Context(), id, duration)
|
||||
if err != nil {
|
||||
// change code to 500
|
||||
|
||||
Reference in New Issue
Block a user