mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-02-03 08:51:11 +08:00
print errlog (jsonv2 marshal)
This commit is contained in:
parent
7b536ac137
commit
a6e278d458
3 changed files with 7 additions and 16 deletions
|
|
@ -410,6 +410,7 @@ func (c *Context) JSON(code int, obj any) {
|
|||
c.Writer.WriteHeader(code)
|
||||
if err := json.MarshalWrite(c.Writer, obj); err != nil {
|
||||
c.AddError(fmt.Errorf("failed to marshal JSON: %w", err))
|
||||
c.Errorf("failed to marshal JSON: %s", err)
|
||||
c.ErrorUseHandle(http.StatusInternalServerError, fmt.Errorf("failed to marshal JSON: %w", err))
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue