Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties not working for ctx.throw #146

Closed
rkoziel opened this issue May 31, 2021 · 0 comments
Closed

Properties not working for ctx.throw #146

rkoziel opened this issue May 31, 2021 · 0 comments

Comments

@rkoziel
Copy link

rkoziel commented May 31, 2021

Hello, I am trying to use the properties parameter with ctx.throw but I do not see the object added anywhere in the response. For example, if part of a request message is missing, I want to do something like the following:

if (!username) {
    return ctx.throw(400, 'Invalid request message', {
        validationErrors: {
            username: 'Username cannot be null',
        },
    });
}

When I try to do a console.log of the response, I see the status and message set properly but I do not see the validationErrors object in the response. Any suggestions on this are appreciated.

@rkoziel rkoziel closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant