save code

This commit is contained in:
白茶清欢 2025-01-27 15:07:58 +08:00
parent e40475cdb1
commit 851de1b3ef
2 changed files with 7 additions and 3 deletions

View File

@ -7,7 +7,11 @@
// Date : 2024-07-20 21:40
package router
// Meta 接口的元信息
// Meta 接口的元信息, 主要包含如下信息:
//
// uri: 接口路由(不包含group前缀)
//
// method: 请求方法: get/post 等
//
// Author : go_developer@163.com<白茶清欢>
//

View File

@ -163,10 +163,10 @@ func registerUri(uriConfig *UriConfig, methodValue reflect.Value, middlewareList
}
err := errData.Interface()
if e, ok := err.(exception.IException); ok {
response.SendWithException(ctx, e, businessData)
response.SendWithException(ctx, e, map[string]any{"business_data": businessData})
return
} else {
response.SendWithException(ctx, exception.NewFromError(-1, errData.Interface().(error)), businessData)
response.SendWithException(ctx, exception.NewFromError(-1, errData.Interface().(error)), map[string]any{"business_data": businessData})
return
}
}