Skip to content

Commit 35730f7

Browse files
kevmoonex3
authored andcommitted
Annotate fail with @alwaysThrows, Remove unreachable throws (#1763)
dart-lang/sdk#31384 was fixed in dart-lang/sdk@0a6253312f Available in Dart 2.0.0-dev.12.0
1 parent 6cc3d5a commit 35730f7

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

lib/src/barback/transformer_isolate.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class TransformerIsolate {
9898
// failed was the one we were loading transformers from, throw an
9999
// application exception with a more user-friendly message.
100100
fail('Transformer library "$packageUri" not found.', error, stackTrace);
101-
return null;
102101
}
103102
}
104103

lib/src/pubspec.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,6 @@ class Pubspec {
880880
if (node == null || node.value == null) return new YamlList();
881881
if (node is YamlList) return node;
882882
_error('Must be a list.', node.span);
883-
884-
// TODO(nweiz): Remove this when sdk#31384 is fixed.
885-
throw "Unreachable";
886883
}
887884

888885
/// Runs [fn] and wraps any [FormatException] it throws in a

lib/src/utils.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'dart:io';
99
import 'dart:math' as math;
1010

1111
import "package:crypto/crypto.dart" as crypto;
12+
import 'package:meta/meta.dart';
1213
import 'package:path/path.dart' as path;
1314
import "package:stack_trace/stack_trace.dart";
1415

@@ -725,6 +726,7 @@ String yamlToString(data) {
725726
}
726727

727728
/// Throw a [ApplicationException] with [message].
729+
@alwaysThrows
728730
void fail(String message, [innerError, StackTrace innerTrace]) {
729731
if (innerError != null) {
730732
throw new WrappedException(message, innerError, innerTrace);

test/descriptor_server.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class DescriptorServer {
9696
_server.mount((request) {
9797
fail("The HTTP server received an unexpected request:\n"
9898
"${request.method} ${request.requestedUri}");
99-
return new shelf.Response.forbidden(null);
10099
});
101100
addTearDown(() => _server.close());
102101
}

0 commit comments

Comments
 (0)