| Index: runtime/bin/process_impl.dart
|
| diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
|
| index bb722500b51370f3da49b0102b8bcbcb3c9a8e57..6c11501a837a197a7b9b736980ebb8395eac9883 100644
|
| --- a/runtime/bin/process_impl.dart
|
| +++ b/runtime/bin/process_impl.dart
|
| @@ -166,10 +166,8 @@ class _InteractiveProcess implements Process {
|
| status);
|
| if (!success) {
|
| close();
|
| - if (_onError !== null) {
|
| - _onError(new ProcessException(status._errorMessage, status._errorCode));
|
| - return;
|
| - }
|
| + _reportError(new ProcessException(status._errorMessage, status._errorCode));
|
| + return;
|
| }
|
| _started = true;
|
|
|
| @@ -242,9 +240,7 @@ class _InteractiveProcess implements Process {
|
|
|
| void kill() {
|
| if (_closed && _pid === null) {
|
| - if (_onError !== null) {
|
| - _onError(new ProcessException("Process closed"));
|
| - }
|
| + _reportError(new ProcessException("Process closed"));
|
| return;
|
| }
|
| if (_killed) {
|
| @@ -255,10 +251,8 @@ class _InteractiveProcess implements Process {
|
| _killed = true;
|
| return;
|
| }
|
| - if (_onError !== null) {
|
| - _onError(new ProcessException("Could not kill process"));
|
| - return;
|
| - }
|
| + _reportError(new ProcessException("Could not kill process"));
|
| + return;
|
| }
|
|
|
| void _kill(int pid) native "Process_Kill";
|
| @@ -284,7 +278,7 @@ class _InteractiveProcess implements Process {
|
| _onExit = callback;
|
| }
|
|
|
| - void set onError(void callback(ProcessException exception)) {
|
| + void set onError(void callback(e)) {
|
| _onError = callback;
|
| }
|
|
|
| @@ -292,6 +286,14 @@ class _InteractiveProcess implements Process {
|
| _onStart = callback;
|
| }
|
|
|
| + void _reportError(e) {
|
| + if (_onError != null) {
|
| + _onError(e);
|
| + } else {
|
| + throw e;
|
| + }
|
| + }
|
| +
|
| String _path;
|
| ObjectArray<String> _arguments;
|
| String _workingDirectory;
|
| @@ -409,7 +411,7 @@ class _NonInteractiveProcess implements Process {
|
| 'be supplied in the callback on completion.');
|
| }
|
|
|
| - void set onError(void callback(ProcessException error)) {
|
| + void set onError(void callback(e)) {
|
| _process.onError = callback;
|
| }
|
|
|
|
|