MCPcopy Create free account
hub / github.com/apache/fory / FromError

Function FromError

go/fory/errors.go:317–328  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

315//
316//go:noinline
317func 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

Callers 15

WriteMethod · 0.85
writeSameTypeMethod · 0.85
writeDifferentTypesMethod · 0.85
ReadDataMethod · 0.85
readDifferentTypesMethod · 0.85
ReadMethod · 0.85
writeDifferentTypesMethod · 0.85
readSameTypeMethod · 0.85
readDifferentTypesMethod · 0.85
WriteMethod · 0.85
ReadMethod · 0.85
writeUnionOverrideValueFunction · 0.85

Calls 2

panicIfEnabledFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected