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
Socket Exception if I enable 'break on all exceptions' in VS code #127427
Comments
@thomas-watchenterprise /cc @DanTup for thoughts if this need to be reported in dart-lang instead ? |
ah, thanks looks like a fix is in sight #126650 (comment) |
The fix linked above is for the specific exception mentioned in that issue, it won't change any behaviour for this exception. However, I believe this is working as intended for the same reasons described in #126650 (comment). Checking "all exceptions" is asking to pause on caught exceptions so it will always have some false positives. You should use "uncaught exceptions" by default, which will not pause on caught exceptions. If there's a reason you feel that doesn't do what you want, please provide an example of where it's not breaking but you think it should because it is very likely better than we improve "uncaught exceptions" than try to eliminate all instances of thrown/caught exceptions in the SDK/packages. That said, if this error occurs in a common case and adds a lot of noise when you do need to use "all exceptions" there might be an argument for trying to eliminate it as has been done with the linked one. Without a code example of how to trigger this to understand under what conditions it happens, it's hard to say. |
I mean the given domain is a valid one, so I don't understand at all that it throws any exception. |
@escamoteur are you able to provide a code sample that triggers this? There's not much context in the screenshots so it's hard to tell what's happening. |
I haven't had the time to create a small repro project but it seems to be related to the linked problem above I guess |
I'm not sure it's related - that issue was specifically about using throw/catch as part of trying to parse an IP address out of a URL (which had a hostname). I could reproduce that, but I could not reproduce this. It's possible it's specific to the hostname you're resolving. It's difficult to be certain without a way to reproduce this, although as noted above, it is recommended to use "Break on uncaught exceptions" for general debugging. If there's a reason you feel that doesn't do what you need, I'd be very interested to know. "All exceptions" is intended to be used for specific situations and will always have the possibility of "false positives". |
In my experience there is a certain group of exceptions that give you a stacktrace that isn't helpful at all if you have break on uncaught exceptions. With break on all you break at the position where the exception occurs which isn't the case in the other option |
It's more information about this that I'm interested in. Several people have mentioned there are some cases where this doesn't do what they'd like, but I haven't had any examples yet. If you're able to provide any, that would really help. "All exceptions" will never be the best debugging experience, so we would be better focusing on trying to make "Uncaught exceptions" better. As noted in the other issue, we already have the ability to cause some "technically caught" exceptions to be treated as "uncaught" (for example so Flutter's own error handler doesn't catch everything and prevent breaking), so it might just be that this needs to be applied in more places. Any examples/repros (for that, or for this original exception) would be really helpful. It's difficult to change these things without steps to reproduce though. |
@thomas-watchenterprise |
@DanTup I'm getting back on this a bit later because I'm too busy at the moment. |
Understood, thanks! I did have another go at trying to reproduce but was not able to. |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Is there an existing issue for this?
Steps to reproduce
In our current app the moment I enable 'break on all exceptions' in VS code and I start the app I get a lot of these exceptions
if I disable this option the app runs without problems
Expected results
no SocketEception
Actual results
Code sample
Code sample
[Paste your code here]
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: