Skip to content
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

We need some way to know what Exceptions are thrown by a function. It's like the type safety doesn't apply to exceptions, it drives me mad. Or ditch try/catch entirely, I don't know. I use Either in my code, but I can't force third party packages or even the official Flutter SDK to use it. There has to be a better solution #56622

Closed
1999ali1999 opened this issue Sep 1, 2024 · 3 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). cherry-pick-review Issue that need cherry pick triage to approve triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug

Comments

@1999ali1999
Copy link

Commit(s) to merge

unknown

Target

unknown

Prepared changelist for beta/stable

unknown

Issue Description

We need some way to know what Exceptions are thrown by a function. It's like the type safety doesn't apply to exceptions, it drives me mad.

Or ditch try/catch entirely, I don't know. I use Either in my code, but I can't force third party packages or even the official Flutter SDK to use it.

There has to be a better solution)

What is the fix

unknown

Why cherry-pick

unknown

Risk

unknown

Issue link(s)

Not found

Extra Info

Not found

@1999ali1999 1999ali1999 added the cherry-pick-review Issue that need cherry pick triage to approve label Sep 1, 2024
@dart-github-bot
Copy link
Collaborator

Summary: The user is frustrated with the lack of type safety for exceptions in Dart. They want a way to know what exceptions a function might throw, similar to how types are enforced for function arguments and return values. They suggest either improving exception type safety or removing try/catch blocks entirely.

@dart-github-bot dart-github-bot added area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug labels Sep 1, 2024
@vsmenon
Copy link
Member

vsmenon commented Sep 1, 2024

Closing as not actionable.

We constantly work toward improving the ergonomics of Dart.

Please feel free to engage on potential language issues at https://github.com/dart-lang/language/issues. But, if you choose to do so, please search the repo for existing issues and try to engage on specific features that would help instead of general comments.

@vsmenon vsmenon closed this as completed Sep 1, 2024
@natebosch
Copy link
Member

See also the existing discussion in dart-lang/language#984 and dart-lang/language#3165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). cherry-pick-review Issue that need cherry pick triage to approve triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants