FromError converts a standard error to a fory Error If err is already a fory Error, it returns it as-is Otherwise wraps it as a deserialization error go:noinline
(err error)
| 315 | // |
| 316 | //go:noinline |
| 317 | func FromError(err error) Error { |
| 318 | if err == nil { |
| 319 | return Error{kind: ErrKindOK} |
| 320 | } |
| 321 | if e, ok := err.(Error); ok { |
| 322 | return e |
| 323 | } |
| 324 | return panicIfEnabled(Error{ |
| 325 | kind: ErrKindDeserializationFailed, |
| 326 | message: err.Error(), |
| 327 | }) |
| 328 | } |
| 329 | |
| 330 | // Pointer receiver methods for *Error (used for error accumulation) |
| 331 |
no test coverage detected