Skip to content

7 - only_throw_errors lint #1297

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

Closed
wants to merge 1 commit into from

Conversation

commit-id:40c7a061
Copy link
Collaborator

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto comments for the other changes in this PR.

@@ -10,6 +10,7 @@
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: no_leading_underscores_for_local_identifiers
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: only_throw_errors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we throwing that doesn't extend Error or Exception? We probably should not be doing that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A string, I'll fix these once #561 lands.

@@ -27,11 +29,11 @@ class Experiment {
factory Experiment.fromString(String s) {
final search = available.where((element) => element.name == s);
if (search.isEmpty) {
throw 'The experiment $s is not available in this version.';
log.fatal('The experiment $s is not available in this version.');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this stop execution? Or are we going to have more subsequent errors now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stops execution.

@HosseinYousefi HosseinYousefi deleted the spr/main/40c7a061 branch September 17, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants