Commit c20cc9f1 authored by Eric Myhre's avatar Eric Myhre

Observation on error handling.

Leaving as a comment for now because it's not at the top of the
priority-heap of refactors I want to chase right now.
Signed-off-by: default avatarEric Myhre <hash@exultant.us>
parent a0da09a0
......@@ -11,6 +11,12 @@ import (
// For example, calling AsString on a map will return ErrWrongKind.
// Calling TraverseField on an int will similarly return ErrWrongKind.
type ErrWrongKind struct {
// CONSIDER: if we should add a `TypeName string` here as well?
// It seems to be useful information, and in many places we've shoved it
// along with the MethodName; but while that's fine for the printed message,
// we could do better internally (and it would enable `typed.wrapnode*` to
// touch this field on its way out in a nice reusable way).
// MethodName is literally the string for the operation attempted, e.g.
// "AsString".
MethodName string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment