-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Debugging in VS Code throws uncaught exceptions #47692
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
Comments
@cskau-g Could you take a look at this? (Related to the |
There has been an new release for the package with the following PR cfug/dio#1317 (version 4.0.2), which resolved the unhandled exception for me while debugging. Not sure if this was expected from the package itself or its should be investigated more |
@a7md0 I think I may have initially misunderstood what you're reporting, but correct me if I'm wrong here: The code in the linked repo. does in fact correctly catch the expected error in the catch block here: Rather, the actual issue you're reporting is that your Which is thrown from here: This is however working as intended. The offending code in _dispatchRequest(reqOpt).then(...); The call to The reason cfug/dio#1317 changes this behaviour is that while it's still an unawaited future, they now attach an error handler to it, meaning the exception is no longer uncaught. |
@cskau-g Thanks for investigating! |
Correct! Should there be a way, in any IDE, to disable the debugger
stopping on exceptions thrown from libraries used in our projects which can
be handled like the one in Dio library?
…On Fri, 26 Nov 2021, 14:43 Martin Kustermann, ***@***.***> wrote:
@cskau-g <https://github.com/cskau-g> Thanks for investigating!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#47692 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4QURS42LLHAG2CFR6BBE3UN6FH3ANCNFSM5H6P5INQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@markfili, if you're asking for a way to disable stops on uncaught exceptions, then that already exists as you can use e.g. DevTools to toggle the debugger behaviour for exceptions (stop on none, uncaught, or all) through the service protocol. Whether this is exposed in your IDE of choice is of course up to the IDE/extension authors. If you want more granular control, to set the behaviour per library, then I think that's a feature request for service protocol. (Please file a separate issue for that.) |
Hi @cskau-g, Regarding this issue for This is a reproducible Gist. As you can see, with defining an Could you please take a look at this if possible? |
I'm not sure if this is the right place to file this issue, but this is related to #37953. The reproduction repository is provided, which uses 3rd party HTTP client package (flutterchina/dio). To recap, awaiting a Future that may fail from the library (e.g., 404 HTTP GET request) will throw an uncaught exception, even though the call is surrounded with try/catch block (the catch block get executed directly after skipping the uncaught exception).
1.62.1 f4af3cbf5a99787542e2a30fe1fd37cd644cc31f x64
Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
The text was updated successfully, but these errors were encountered: