fix(errors): panic when err of Clone is nil (#2176)

pull/2175/merge
川桑 2 years ago committed by GitHub
parent c9fbb27b5b
commit d88052b7dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      errors/errors.go

@ -106,6 +106,9 @@ func Reason(err error) string {
// Clone deep clone error to a new error.
func Clone(err *Error) *Error {
if err == nil {
return nil
}
metadata := make(map[string]string, len(err.Metadata))
for k, v := range err.Metadata {
metadata[k] = v

Loading…
Cancel
Save