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

Middleware-sample-logging to have a switch not to print uncaught errors #145

Closed
lkhari opened this issue Jan 27, 2020 · 5 comments
Closed

Comments

@lkhari
Copy link
Contributor

lkhari commented Jan 27, 2020

This is a Feature Proposal

Description

  • Middleware-sample-logging print all uncaught lambda errors. In certain sitatuations you don't want the uncaught errors to log out an error, like in the context of Step functions and Lambdas tied to appsync. I'm suggesting being able to configure if it does or not.

Similar or dependent issues:

@theburningmonk
Copy link
Contributor

@lkhari while I think it's a good option to have, I don't understand why you wouldn't want an error log message in the case of Step Functions and AppSync resolver functions. Can you clarify?

@lkhari
Copy link
Contributor Author

lkhari commented Jan 28, 2020

An example is, on the site i'm working we have very little frontend validation. So often the requests come to the backend through appsync and aren't suited due to incorrect dates etc. I can't return the message back through graphql since it's expecting a specific entity, so I throw a validation error.

I use error logging as more high priority issues which require fixing urgently, which these validation errors are often not an issue so i log them as warnings.

That's my reason, but I can also see people wanting to be able to format the message diffferently like in issue #98

Note: if you have a better way of returning validation errors, i'm happy to hear.

@theburningmonk
Copy link
Contributor

mm.. I see, the problem here is that when something does go wrong (not related to validation) then you also won't have those error log messages, which captures the invocation event, etc.

#98 is a different case, the core problem (here) is that they have a specific logging convention so want to override the log message itself & also increment a custom metric, something that they'd be able to do easily with a custom logger.

@lkhari
Copy link
Contributor Author

lkhari commented Jan 28, 2020

Yea, that is true. I think, to be honest, if you have made the decision to turn off the error catching in this package, then you most likely going to understand that you must handle errors in your code.

@theburningmonk
Copy link
Contributor

fixed by #146

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