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
Expected result:
The retry handler treats the non-extendable like any other (minus the decorating of course).
Actual result:
An UnhandledPromiseRejectionWarning is generated, the code continues on neither the resolution nor the rejection path.
Generally the code seems to not be well defended against errors from unexpected sources. For example. throwing from the onFailedAttempt function would also result in an unhandled rejection.
The text was updated successfully, but these errors were encountered:
openreply-dleinhaeuser
changed the title
Non-object rejections result in unhandled rejection
Non-extensible rejections result in unhandled rejection
May 13, 2019
As I had the same issue, I solved it by wrapping the actual function call in an own function. In there, the non-extendable error can be cought and replaced by an extendable one.
So, instead of
constresponse=awaitdoSomething()
I created a new function
asyncfunctiontrySomething(){try{awaitdoSomething()return"Success"}catch(e){//console.log(e)throw(newError("Could not do something"))}}
If the
input
function somehow rejects with a non-object,decorateErrorWithCounts
will throw an error which leads to an unhandled rejection.Example:
Expected result:
The retry handler treats the non-extendable like any other (minus the decorating of course).
Actual result:
An
UnhandledPromiseRejectionWarning
is generated, the code continues on neither the resolution nor the rejection path.Generally the code seems to not be well defended against errors from unexpected sources. For example. throwing from the
onFailedAttempt
function would also result in an unhandled rejection.The text was updated successfully, but these errors were encountered: