feat(sync): full code sync from release
This commit is contained in:
@@ -16,6 +16,16 @@ func ToHTTP(err error) (statusCode int, body Status) {
|
||||
return http.StatusOK, Status{Code: int32(http.StatusOK)}
|
||||
}
|
||||
|
||||
cloned := Clone(appErr)
|
||||
return int(cloned.Code), cloned.Status
|
||||
body = Status{
|
||||
Code: appErr.Code,
|
||||
Reason: appErr.Reason,
|
||||
Message: appErr.Message,
|
||||
}
|
||||
if appErr.Metadata != nil {
|
||||
body.Metadata = make(map[string]string, len(appErr.Metadata))
|
||||
for k, v := range appErr.Metadata {
|
||||
body.Metadata[k] = v
|
||||
}
|
||||
}
|
||||
return int(appErr.Code), body
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user