Skip to content

Custom error messages #103

Open
Open

Description

Errors raised in a resolver — let's take

ErrValueError:  "Field '$1' cannot be resolved: \"$2\"" % [msg[0], msg[1]]

get they type after a RespResult holding a message string and the place where they're occur.
Comparing the situation to other GraphQL implementations, I'm wondering if there's a way to provide custom error messages ?
Perhaps raising an other exception when an unspecified error kind is met,
and adding a custom one with no formatting along the lines ?

"ASSERT: UNSPECIFIED ERR KIND: " & $err

Also, is it possible to stack them in a sequence before returning ?
I tried with ctx.errors.add but this is a user context, not the calling one (if that makes sense, but I'm still building the mental picture of the mechanisms). If not I would gladly PR on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions