MCPcopy Create free account
hub / github.com/brimdata/super / WrapError

Method WrapError

context.go:622–632  ·  view source on GitHub ↗
(msg string, val Value)

Source from the content-addressed store, hash-verified

620}
621
622func (c *Context) WrapError(msg string, val Value) Value {
623 recType := c.MustLookupTypeRecord([]Field{
624 {"message", TypeString, false},
625 {"on", val.Type(), false},
626 })
627 errType := c.LookupTypeError(recType)
628 var b scode.Builder
629 b.Append(EncodeString(msg))
630 b.Append(val.Bytes())
631 return NewValue(errType, b.Bytes())
632}
633
634func (c *Context) Nullable(typ Type) *TypeUnion {
635 var types []Type

Callers 15

EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80
EvalMethod · 0.80

Calls 8

MustLookupTypeRecordMethod · 0.95
LookupTypeErrorMethod · 0.95
AppendMethod · 0.95
BytesMethod · 0.95
EncodeStringFunction · 0.85
NewValueFunction · 0.85
TypeMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected