We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Just trying out Middy and have a small issue with returning early from a before middleware. I'm using Node 8.10 with async.
before
async
My middleware looks like this:
const validate = (config) => { return ({ before: async (handler, next) => { throw new Error('This is not a booking') } }) }
This does not return early with an error though I thought it would do. It seems to return to the function and continue executing it instead.
If I change before to after (which is of course not what I want):
const validate = (config) => { return ({ after: async (handler, next) => { throw new Error('This is not a booking') } }) }
then this returns the actual error, I assume because it's the last piece of code that is run.
How can I get the before part to return with an error before the Lambda itself is called?
The text was updated successfully, but these errors were encountered:
Can you please re-test this using the v1 branch using node >= v10. CLosing for now, please re-open if necessary.
Sorry, something went wrong.
No branches or pull requests
Just trying out Middy and have a small issue with returning early from a
before
middleware. I'm using Node 8.10 withasync
.My middleware looks like this:
This does not return early with an error though I thought it would do. It seems to return to the function and continue executing it instead.
If I change before to after (which is of course not what I want):
then this returns the actual error, I assume because it's the last piece of code that is run.
How can I get the before part to return with an error before the Lambda itself is called?
The text was updated successfully, but these errors were encountered: