Skip to content

Distinguishing between errors #14

@matthewmueller

Description

@matthewmueller

Is it currently possible to distinguish between response errors and network errors in RPCC?

For example, with the DOM.getNodeForLocation method, it can sometimes return an error: No node found at given location. I don't really want to error out in all cases of this error, but for things like the RPCC websocket disconnecting, I would like to error out immediately.

Is there anyway to distinguish between these types of errors? Here's some (incorrect) psuedocode of what I'm trying to accomplish:

var args cdpcmd.DOMGetNodeForLocationArgs
if e := json.Unmarshal(req.Params, &args); e != nil {
	return raw, e
}
reply, err := c.DOM.GetNodeForLocation(ctx, &args)
if err != nil {
        if err.(*ResponseError) { 
           // handle differently
        } 
	return raw, err
}
return json.Marshal(reply)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions