-
Notifications
You must be signed in to change notification settings - Fork 334
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
[Feature Request]: Enhance SQSError with AWS error $response object for Better Debugging #495
Comments
Hey, thanks for raising this issue! This makes a lot of sense, not sure why we don't already really. |
I've popped an initial mock up here: #496 This keeps the error object the same as it is today by default but adds a new option that will extend the output with both response and metadata, so best of both worlds. |
🎉 This issue has been resolved in version 10.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks 👍 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Describe the bug
Description:
Currently, when an error occurs in the
deleteMessage
method of the sqs-consumer npm library, the thrown error from AWS includes a$response
object which is crucial for debugging. However, this$response
object is not accessible through the SQSError, which makes it challenging to understand the underlying issue, especially in cases of deserialization errors.Error message example: "SQS delete message failed: Unexpected token < in JSON at position 0\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object."
For instance, if the SQS
deleteMessage
operation fails due to an unexpected token in the JSON (e.g., "Unexpected token < in JSON at position 0"), the raw response from AWS could provide critical insights into what went wrong. Unfortunately, without access to the$response
object, developers are left guessing, potentially leading to increased debugging time and slower resolution.Proposal:
Extend the SQSError class to include the
$response
object from AWS errors. This enhancement would allow developers to inspect the raw AWS response directly from the SQSError instance, facilitating quicker and more effective troubleshooting.Impact:
Incorporating the
$response
object into SQSError would significantly improve the developer experience by providing more detailed error contexts directly, aiding in faster bug resolutions and reducing downtime in production environments.Thanks
Your minimal, reproducible example
https://gist.github.com/nirf/f2ac58f2a6a837d4f3a55d491a395dab
Steps to reproduce
update the toSQSError function
Expected behavior
access to the aws error $response object for better debugging
How often does this bug happen?
Often
Screenshots or Videos
No response
Platform
Node version - 18.12.1
Package version
7.5.0
AWS SDK version
3.428.0
Additional context
Great Library :-)
The text was updated successfully, but these errors were encountered: