Skip to content
Snippets Groups Projects
Commit 68149fc6 authored by rnystrom@google.com's avatar rnystrom@google.com Committed by Natalie Weizenbaum
Browse files

Don't show a stack trace on a bad path dependency path.

This is a user-facing error, so there shouldn't be a stack dump.

BUG=https://code.google.com/p/dart/issues/detail?id=10123
R=nweiz@google.com

Review URL: https://codereview.chromium.org//14662003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@22448 260f80e4-7a28-3924-810f-c04153c831b5
parent 5ed07b30
No related branches found
No related tags found
No related merge requests found
......@@ -110,18 +110,17 @@ class PathSource extends Source {
/// Ensures that [description] is a valid path description. It must be a map,
/// with a "path" key containing a path that points to an existing directory.
/// Throws a [FormatException] if the path is invalid.
/// Throws an [ApplicationException] if the path is invalid.
void _validatePath(String name, description) {
var dir = description["path"];
if (dirExists(dir)) return;
if (fileExists(dir)) {
throw new FormatException(
"Path dependency for package '$name' must refer to a "
"directory, not a file. Was '$dir'.");
fail("Path dependency for package '$name' must refer to a "
"directory, not a file. Was '$dir'.");
}
throw new FormatException("Could not find package '$name' at '$dir'.");
fail("Could not find package '$name' at '$dir'.");
}
}
......@@ -7,7 +7,6 @@ import 'dart:io';
import 'package:pathos/path.dart' as path;
import 'package:scheduled_test/scheduled_test.dart';
import '../../../lib/src/exit_codes.dart' as exit_codes;
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
......@@ -34,6 +33,6 @@ main() {
schedulePub(args: ['install'],
error:
new RegExp("Could not find package 'foo' at '$escapePath'."),
exitCode: exit_codes.DATA);
exitCode: 1);
});
}
\ No newline at end of file
......@@ -5,7 +5,6 @@
import 'package:pathos/path.dart' as path;
import 'package:scheduled_test/scheduled_test.dart';
import '../../../lib/src/exit_codes.dart' as exit_codes;
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
......@@ -38,6 +37,6 @@ main() {
schedulePub(args: ['install'],
error: new RegExp("Path dependency for package 'foo' must refer to a "
"directory, not a file. Was '$escapePath'."),
exitCode: exit_codes.DATA);
exitCode: 1);
});
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment