You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cue API extensively uses the capability to return Values holding an error rather than
return (Value, error) pairs. However, there is no way to use the API to create a Value holding
an arbitrary error. This means that it's not easily possible for non-core packages to provide
a similar API or to wrap the cue API while preserving the same style of interface.
We should provide this capability, for example by adding a method like this:
package cue
// Error returns a new Value holding the given error.
func (ctx *Context) Error(err error) Value
Another possibility might be to overload Context.Encode: if its argument implements error, it could
return an error value.
The text was updated successfully, but these errors were encountered:
The cue API extensively uses the capability to return Values holding an error rather than
return
(Value, error)
pairs. However, there is no way to use the API to create a Value holdingan arbitrary error. This means that it's not easily possible for non-core packages to provide
a similar API or to wrap the cue API while preserving the same style of interface.
We should provide this capability, for example by adding a method like this:
Another possibility might be to overload
Context.Encode
: if its argument implementserror
, it couldreturn an error value.
The text was updated successfully, but these errors were encountered: