Comments (7)
Thanks for the report. π
this exception is caught so I'm not sure if it's an actual issue
I introduced this issue, at that time I did not realize that while the exception is caught it could be annoying when tooling is set to break on all exceptions, for instance on VSCode:
This was fixed on master and beta by #141205.
For more details, see #144505 (comment).
from flutter.
Interesting.
From the Dart page you pointed, my reading of "Exceptions are errors indicating that something unexpected happened. ", is that 'unexpected' does not apply to this specific case (checking if the result of queryTextActions
is null as I did initially).
as a Flutter developer, you have different constraints than an App developer?
I think every frameworks and apps set their own priorities. For Flutter, developper experience is a very high priority (see https://github.com/flutter/flutter/wiki/Values#-focus-on-the-user-and-all-else-will-follow). That's why the annoyance of having VS debugger (and probably other debuggers) stopping on this particular exception had to be considered (especially because, in this particular case, there was a more developper friendly alternative).
from flutter.
Thanks @bleroux for the tip.
@stephane-archer I verified this on master and didn't get any exception while opening the dialog running the code sample on desktop, mobile and web platforms.
Based on above comment and since the fix is in place in master, I'll close this as fixed per triage policy. If you disagree, write in comments and I'll reopen it.
from flutter.
thanks, @bleroux and @darshankawar for being so reactive, so from my understanding, Dart recommended error handling is to use exception but the Flutter team can not use that because of VScode π . https://dart.dev/language/error-handling
from flutter.
thanks, @bleroux and @darshankawar for being so reactive,
π
so from my understanding, Dart recommended error handling is to use exception but the Flutter team can not use that because of VScode π . https://dart.dev/language/error-handling
Not exactly, here I made a basic mistake π
which was to rely on exception for a non-exceptionnal case which was queryTextActions
returning null. It is non-exceptionnal because this is intended on platforms that does not implement this feature on the engine side and it was possible to take care of this case without relying on exception.
from flutter.
@bleroux you mention that exceptions should be used only for exceptional cases, and while it is true for some languages (C++, Go), the documentation of Dart only mentions for error handling to use exceptions https://dart.dev/language/error-handling
Exceptions usually simplify the return types of the API and help separate the bad and the happy paths.
In some languages, it's the preferred way for error handling.
Reading the documentation I understood that exceptions could be used not only for exceptional cases.
Do you know if my understanding was wrong or is it because as a Flutter developer, you have different constraints than an App developer?
from flutter.
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 flutter doctor -v
and a minimal reproduction of the issue.
from flutter.
Related Issues (20)
- Golden file tests don't work locally HOT 1
- Golden file tests don't work locally HOT 7
- βοΈ Make Device Doctor more robust
- [split_config.arm64_v8a.apk!libflutter.so] issue i tried to solve it but still showing error
- Add entrypoint URL prefix configuration to new web bootstrapping
- {CODe}The Fortnite V-Bucks Codes List June Update V-Bucks Code Generator 2024-2025 FREE FOR ALL[V9]
- [GET 10K-200K]**Free TikTok Follower Generator 2024-2025: Latest Tips and Tricks
- [NEW_CODE]~+βfree fortnite v bucks codes generator 2024-2025 free vbucks codes full list V Bucks Generator [ X7Q] HOT 1
- mac-10 lost external connection phone device. HOT 1
- +β+β)free fortnite v bucks codes generator 2024 free vbucks codes full list HOT 1
- {June_UpDate}~Unused Free V-Bucks Fortnite Codes 2024 Working Unique Code List HOT 1
- linux-51 is dead. HOT 1
- ++(Don't Miss Out free fortnite v bucks codes generator 2024-2025 free vbucks codes full list June Updates HOT 1
- [Impeller] non-uniform image filter blurs don't render correctly
- {100% Working}~Free CashApp Money Generator: Real and Workingβ GET Updated $750 Cash App Money Code
- [shared_preferences] add setStringIterable HOT 3
- [Impeller] remove SkSL compilation for iOS projects once Skia backend is removed.
- Move useful Flutter types out of Flutter
- flutter upgrade
- White color appearing on resizing map height
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.