-
Notifications
You must be signed in to change notification settings - Fork 67
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
Conversation
commit-id:40c7a061
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stops execution.
Stack:
unreachable_from_main
lint #1302unnecessary_parenthesis
lint #1301unnecessary_lambdas
lint #1300type_annotate_public_apis
lint #1299prefer_single_quotes
lint #1298only_throw_errors
lint #1297 ⬅omit_local_variable_types
lint #1296lines_longer_than_80_chars
lint #1295library_annotations
lint #1294directives_ordering
lint #1293comment_references
lint #1292avoid_catching_errors
lint #1291