-
Notifications
You must be signed in to change notification settings - Fork 14
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
UnhandledPromiseRejection when call to SQS deleteMessageBatch rejects #50
Comments
@jmac105 thanks for reporting the issue! I will check it right away :-) |
regevbr
added a commit
that referenced
this issue
Sep 17, 2019
regevbr
added a commit
that referenced
this issue
Sep 17, 2019
1 task
regevbr
added a commit
that referenced
this issue
Sep 17, 2019
regevbr
added a commit
that referenced
this issue
Sep 17, 2019
regevbr
added a commit
that referenced
this issue
Sep 17, 2019
@jmac105 the issue is fixed and released in 4.0.7 |
Fantastic response time, thanks @regevbr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your issue may already be reported!
Please search on the issue tracker before creating one.
Expected Behavior
If the call to deleteMessageBatch rejects, then that rejected Promise should be handled properly and not bubble up.
Current Behavior
An UnhandledPromiseRejectionWarning is logged to console, for example:
(node:58881) UnhandledPromiseRejectionWarning: AWS.SimpleQueueService.NonExistentQueue: The specified queue does not exist for this wsdl version.
Possible Solution
The cause of this bug is that a rejected Promise is returned from https://github.com/PruvoNet/squiss-ts/blob/master/src/Squiss.ts#L352, however that rejected Promise is not caught at https://github.com/PruvoNet/squiss-ts/blob/master/src/Squiss.ts#L471 which is where the call to _
deleteMessages
occurs.Proposed solutions:
_deleteMessages
, the error has already been emitted so no need to reject as well?.catch()
handler in_deleteXMessages
which suppresses the errorSteps to Reproduce (for bugs)
Can be replicated via the unit tests. For visibility set https://github.com/PruvoNet/squiss-ts/blob/master/src/test/src/index.spec.ts#L725 to be the only test to run:
it.only('emits error when delete call fails', () => {
Warnings can then be seen in the console
Context
We are currently testing out squiss-ts by testing it in different scenarios before implementing in production code. A real world example which would cause an error like this would be a network blip.
Your Environment
squiss-ts: 4.0.6
Node: 8.16.1
The text was updated successfully, but these errors were encountered: