aws-sdk-js-v3
aws-sdk-js-v3 copied to clipboard
Uncaught Exception complicates debugging
SDK v3.12.0 Node v14.15.0 Visual Studio Code v1.55.2 for debugging Credentials loaded from ~/.aws/credentials Actual package loaded @aws-sdk/client-s3 v3.12.0
I typically debug with "uncaught exceptions" turned on. The code in line 16 below pre-generates a default rejected promise that is then typically overwritten in the loop on the following lines.
https://github.com/aws/aws-sdk-js-v3/blob/4f9f4a79b019c1c35530e05c4138fde88a6fb547/packages/property-provider/src/chain.ts#L16-L25
Promise.reject is considered an uncaught exception by the debugger thus it pauses here on each debug run. Even though the credentials are ultimately successfully loaded from the default location ~/.aws/credentials I need to step through this "exception" before actually getting to my code that I'm targeting for debug.
I believe a better solution would be to restructure the loop so the final return is where the rejected promise is generated.
This has been driving me absolutely mad the last 3 days
Still happening with version 3.85.0 I also spent like two hours trying to figure out what I did wrong. Turns out that nothing. I am glad this issue exists at least!
Has anyone found a workaround to silence that exception in the meantime?
Still happening with v3.127.0
+1
+1
+1 ...this is driving my team nuts.
+1 this is still happening
Hi all,
I have marked this for prioritization, if someone wants to take a stab at a PR that would be very appreciated.
Thanks, Ran~
We discussed using async-await instead of creating promise.
Verified that VSCode pauses on Promise.reject when "Uncaught Exceptions" is turned on.
Screen recording
https://github.com/aws/aws-sdk-js-v3/assets/16024985/54a4fff2-b6c9-4a8c-9d78-18abded150eb
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.