3 Star 2 Fork 0

info-superbahn-ict / superbahn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
impl.go 518 Bytes
一键复制 编辑 原始数据 按行查看 历史
tangshibo 提交于 2021-12-21 19:26 . update
package web_apis
import (
"encoding/json"
"fmt"
"gitee.com/info-superbahn-ict/superbahn/internal/supbmanager/v3_test/modules/web-apis/clireq"
"net/http"
)
func (r *WebServer)responseErr(w http.ResponseWriter, format string, err error) {
msg := fmt.Sprintf(format, err)
resp := &clireq.Response{
Code: http.StatusBadRequest,
Message: msg,
Data: nil,
}
bts, _ := json.Marshal(resp)
if _, err := w.Write(bts); err != nil {
r.logger.Errorf("write response %v", err)
}
r.logger.Errorf(format,err)
}
Go
1
https://gitee.com/info-superbahn-ict/superbahn.git
git@gitee.com:info-superbahn-ict/superbahn.git
info-superbahn-ict
superbahn
superbahn
5fda629dab96

搜索帮助