Skip to content

Commit edc6b22

Browse files
authored
Emit exit code 69 for TlsExceptions (#1730)
Closes #1729
1 parent 3f0fd63 commit edc6b22

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/src/command_runner.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
235235
if (exception is HttpException ||
236236
exception is http.ClientException ||
237237
exception is SocketException ||
238+
exception is TlsException ||
238239
exception is PubHttpException ||
239240
exception is DependencyNotFoundException) {
240241
return exit_codes.UNAVAILABLE;

lib/src/source/hosted.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,16 @@ class BoundHostedSource extends CachedSource {
327327
"to find package $package at $url.",
328328
error,
329329
stackTrace);
330-
}
331-
332-
if (error is io.SocketException) {
330+
} else if (error is io.SocketException) {
333331
fail("Got socket error trying to find package $package at $url.", error,
334332
stackTrace);
333+
} else if (error is io.TlsException) {
334+
fail("Got TLS error trying to find package $package at $url.", error,
335+
stackTrace);
336+
} else {
337+
// Otherwise re-throw the original exception.
338+
throw error;
335339
}
336-
337-
// Otherwise re-throw the original exception.
338-
throw error;
339340
}
340341

341342
/// Given a URL, returns a "normalized" string to be used as a directory name

0 commit comments

Comments
 (0)