Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3914)

Unified Diff: runtime/bin/process_impl.dart

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/process_impl.dart
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
index a6e4424f59fa937892fb191ac716b148cbc3dfd7..c618a5bf6e6380c5f04a054f72cd02e8c1489782 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -21,19 +21,19 @@ class _Process extends NativeFieldWrapperClass1 implements Process {
List<String> arguments,
ProcessOptions options) {
if (path is !String) {
- throw new IllegalArgumentException("Path is not a String: $path");
+ throw new ArgumentError("Path is not a String: $path");
}
_path = path;
if (arguments is !List) {
- throw new IllegalArgumentException("Arguments is not a List: $arguments");
+ throw new ArgumentError("Arguments is not a List: $arguments");
}
int len = arguments.length;
_arguments = new ObjectArray<String>(len);
for (int i = 0; i < len; i++) {
var arg = arguments[i];
if (arg is !String) {
- throw new IllegalArgumentException("Non-string argument: $arg");
+ throw new ArgumentError("Non-string argument: $arg");
}
_arguments[i] = arguments[i];
if (Platform.operatingSystem == 'windows') {
@@ -44,7 +44,7 @@ class _Process extends NativeFieldWrapperClass1 implements Process {
if (options !== null && options.workingDirectory !== null) {
_workingDirectory = options.workingDirectory;
if (_workingDirectory is !String) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"WorkingDirectory is not a String: $_workingDirectory");
}
}
@@ -52,12 +52,12 @@ class _Process extends NativeFieldWrapperClass1 implements Process {
if (options !== null && options.environment !== null) {
var env = options.environment;
if (env is !Map) {
- throw new IllegalArgumentException("Environment is not a map: $env");
+ throw new ArgumentError("Environment is not a map: $env");
}
_environment = [];
env.forEach((key, value) {
if (key is !String || value is !String) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Environment key or value is not a string: ($key, $value)");
}
_environment.add('$key=$value');
@@ -224,7 +224,7 @@ class _Process extends NativeFieldWrapperClass1 implements Process {
void kill([ProcessSignal signal = ProcessSignal.SIGTERM]) {
if (signal is! ProcessSignal) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Argument 'signal' must be a ProcessSignal");
}
if (!_started) {
@@ -315,14 +315,14 @@ class _NonInteractiveProcess {
if (options.stdoutEncoding !== null) {
stdoutEncoding = options.stdoutEncoding;
if (stdoutEncoding is !Encoding) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'stdoutEncoding option is not an encoding: $stdoutEncoding');
}
}
if (options.stderrEncoding !== null) {
stderrEncoding = options.stderrEncoding;
if (stderrEncoding is !Encoding) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'stderrEncoding option is not an encoding: $stderrEncoding');
}
}

Powered by Google App Engine
This is Rietveld 408576698