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

Method SetError

go/fory/errors.go:333–345  ·  view source on GitHub ↗

Pointer receiver methods for *Error (used for error accumulation) SetError sets the error if no error has occurred yet (first-error-wins)

(err error)

Source from the content-addressed store, hash-verified

331
332// SetError sets the error if no error has occurred yet (first-error-wins)
333func (e *Error) SetError(err error) {
334 if e == nil || e.kind != ErrKindOK {
335 return
336 }
337 if foryErr, ok := err.(Error); ok {
338 *e = foryErr
339 } else if err != nil {
340 *e = Error{
341 kind: ErrKindDeserializationFailed,
342 message: err.Error(),
343 }
344 }
345}
346
347// TakeError returns the error and clears it
348func (e *Error) TakeError() error {

Callers 15

writeSharedTypeMetaMethod · 0.45
readSharedTypeMetaMethod · 0.45
readTypeDefInfoMethod · 0.45
writeTypeMethod · 0.45
readTypeMethod · 0.45
readTypeByReadTagMethod · 0.45
ReadTypeInfoMethod · 0.45
writeMetaStringMethod · 0.45
readMetaStringMethod · 0.45
WriteMethod · 0.45

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected