| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 // TODO(ager): The only reason for this class is that we | 7 // TODO(ager): The only reason for this class is that we |
| 8 // cannot patch a top-level at this point. | 8 // cannot patch a top-level at this point. |
| 9 class _ProcessUtils { | 9 class _ProcessUtils { |
| 10 external static _exit(int status); | 10 external static _exit(int status); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 235 } |
| 236 | 236 |
| 237 | 237 |
| 238 class ProcessException implements Exception { | 238 class ProcessException implements Exception { |
| 239 const ProcessException(String this.executable, | 239 const ProcessException(String this.executable, |
| 240 List<String> this.arguments, | 240 List<String> this.arguments, |
| 241 [String this.message = "", | 241 [String this.message = "", |
| 242 int this.errorCode = 0]); | 242 int this.errorCode = 0]); |
| 243 String toString() { | 243 String toString() { |
| 244 var msg = (message == null) ? 'OS error code: $errorCode' : message; | 244 var msg = (message == null) ? 'OS error code: $errorCode' : message; |
| 245 var args = Strings.join(arguments, ' '); | 245 var args = arguments.join(' '); |
| 246 return "ProcessException: $msg\n Command: $executable $args"; | 246 return "ProcessException: $msg\n Command: $executable $args"; |
| 247 } | 247 } |
| 248 | 248 |
| 249 /** | 249 /** |
| 250 * Contains the executable provided for the process. | 250 * Contains the executable provided for the process. |
| 251 */ | 251 */ |
| 252 final String executable; | 252 final String executable; |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * Contains the arguments provided for the process. | 255 * Contains the arguments provided for the process. |
| 256 */ | 256 */ |
| 257 final List<String> arguments; | 257 final List<String> arguments; |
| 258 | 258 |
| 259 /** | 259 /** |
| 260 * Contains the system message for the process exception if any. | 260 * Contains the system message for the process exception if any. |
| 261 */ | 261 */ |
| 262 final String message; | 262 final String message; |
| 263 | 263 |
| 264 /** | 264 /** |
| 265 * Contains the OS error code for the process exception if any. | 265 * Contains the OS error code for the process exception if any. |
| 266 */ | 266 */ |
| 267 final int errorCode; | 267 final int errorCode; |
| 268 } | 268 } |
| OLD | NEW |