You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that now to handle errors during logging we need to define an onError function for the stream object.
IMO, it should provide a default onError function that swallow errors, since logging should never make your application to crash, which is the current behavior if you haven't defined this function.
Also, maybe since the stream inherits from Writeable, error handling should be performed by using a stream.on('error', function(err) {...}) instead of using this onError function. Or otherwise, we could pass the error function as part of the options. It doesn't feel right to have to define that function directly over the stream.
Opinions?
The text was updated successfully, but these errors were encountered:
README.md states this is a Writable stream, so this module should implement that interface instead of defining its own. Additionally onError is not documented in the README.md.
This just happened to us as well when we hit a ThrottlingException. We ended up needing to wrap the logging calls in a domain to avoid the error from blowing up the Express web server. There needs to be a documented best practice and examples on how to handled these types of errors.
It seems that now to handle errors during logging we need to define an
onError
function for the stream object.IMO, it should provide a default
onError
function that swallow errors, since logging should never make your application to crash, which is the current behavior if you haven't defined this function.Also, maybe since the stream inherits from Writeable, error handling should be performed by using a
stream.on('error', function(err) {...})
instead of using thisonError
function. Or otherwise, we could pass the error function as part of the options. It doesn't feel right to have to define that function directly over the stream.Opinions?
The text was updated successfully, but these errors were encountered: