sqs-producer
sqs-producer copied to clipboard
Attach failed message ids to error object
Description: Throw a custom error, when messages fail to send, with an additional property to expose the failed message ids for programmatic access.
Type of change:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Why is this change required?: In cases where we have to take additional steps for the failed messages, we have to parse the error message in order to get their IDs.
Code changes:
- Add a custom
FailedMessagesError
error class, with afailedMessages
property of typestring[]
to hold the IDs of the messages that failed to send.
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.