func (e Error) UnmarshalData(v interface{}) error {
	if !e.HasData() {
		return ErrNoData
	}
	return json.Unmarshal(e.Data, v)
}
UnmarshalData decodes the error data associated with e into v.  It reports
ErrNoData without modifying v if there was no data message attached to e.
package jrpc2
import (
	"encoding/json"
	"errors"
	"fmt"
	"github.com/creachadair/jrpc2/code"
)
type Error struct {
	Message string           
	Code    code.Code        
	Data    json.RawMessage  
}
func (e Error) Error() string { return fmt.Sprintf("[%d] %s", e.Code, e.Message) }
func (e Error) HasData() bool { return len(e.Data) != 0 }
func (e Error) ErrCode() code.Code { return e.Code }