code: func onError(err error) {
  	// TODO do not marshal options again here
  	switch e := err.(type) {
  	case dnode.MethodNotFoundError: // Tell the requester "method is not found".
  		args, err2 := e.Args.Slice()
  		if err2 != nil {
  			return
  		}
  
  		if len(args) < 1 {
  			return
  		}
  
  		var options callOptions
  		if err := args[0].Unmarshal(&options); err != nil {
  			return
  		}
  
  		if options.ResponseCallback.Caller != nil {
  			response := Response{
  				Result: nil,
  				Error: &Error{
  					Type:    "methodNotFound",
  					Message: err.Error(),
  				},
  			}
  			options.ResponseCallback.Call(response)
  		}
  	}
  }
docs: // onError is called when an error happened in a method handler.