(msg string, val Value)
| 620 | } |
| 621 | |
| 622 | func (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 | |
| 634 | func (c *Context) Nullable(typ Type) *TypeUnion { |
| 635 | var types []Type |
no test coverage detected