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

Annotate fail with @alwaysThrows, Remove unreachable throws #1763

Merged
merged 1 commit into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/src/barback/transformer_isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class TransformerIsolate {
// failed was the one we were loading transformers from, throw an
// application exception with a more user-friendly message.
fail('Transformer library "$packageUri" not found.', error, stackTrace);
return null;
}
}

Expand Down
3 changes: 0 additions & 3 deletions lib/src/pubspec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,6 @@ class Pubspec {
if (node == null || node.value == null) return new YamlList();
if (node is YamlList) return node;
_error('Must be a list.', node.span);

// TODO(nweiz): Remove this when sdk#31384 is fixed.
throw "Unreachable";
}

/// Runs [fn] and wraps any [FormatException] it throws in a
Expand Down
2 changes: 2 additions & 0 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'dart:io';
import 'dart:math' as math;

import "package:crypto/crypto.dart" as crypto;
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path;
import "package:stack_trace/stack_trace.dart";

Expand Down Expand Up @@ -725,6 +726,7 @@ String yamlToString(data) {
}

/// Throw a [ApplicationException] with [message].
@alwaysThrows
void fail(String message, [innerError, StackTrace innerTrace]) {
if (innerError != null) {
throw new WrappedException(message, innerError, innerTrace);
Expand Down
1 change: 0 additions & 1 deletion test/descriptor_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class DescriptorServer {
_server.mount((request) {
fail("The HTTP server received an unexpected request:\n"
"${request.method} ${request.requestedUri}");
return new shelf.Response.forbidden(null);
});
addTearDown(() => _server.close());
}
Expand Down