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

Custom error response #766

Closed
artemyarulin opened this issue Jan 6, 2024 · 2 comments
Closed

Custom error response #766

artemyarulin opened this issue Jan 6, 2024 · 2 comments

Comments

@artemyarulin
Copy link

There is good example of custom errors https://github.com/awslabs/aws-lambda-rust-runtime/blob/main/examples/basic-error-handling/src/main.rs but what if I need to specify custom error HTTP code, additional headers and a body for the error response? I can always catch and convert my custom error to the Response manually, but wonder if there is a better way?

@calavera
Copy link
Contributor

calavera commented Jan 9, 2024

The Runtime is deliberately agnostic. You need to handle creating the right responses for your app.

@calavera calavera closed this as completed Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for the maintainers of this repository to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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

2 participants