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

Side by Side Diff: runtime/bin/process_impl.dart

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class _ProcessStartStatus { 5 class _ProcessStartStatus {
6 int _errorCode; // Set to OS error code if process start failed. 6 int _errorCode; // Set to OS error code if process start failed.
7 String _errorMessage; // Set to OS error message if process start failed. 7 String _errorMessage; // Set to OS error message if process start failed.
8 } 8 }
9 9
10 10
11 class _Process implements Process { 11 class _Process implements Process {
12 12
13 _Process(String path, List<String> arguments) { 13 _Process(String path, List<String> arguments) {
14 if (path is !String) {
15 throw new ProcessException("Path is not a String: $path");
16 }
14 _path = path; 17 _path = path;
15 { 18
16 int len = arguments.length; 19 if (arguments is !List) {
17 _arguments = new ObjectArray<String>(len); 20 throw new ProcessException("Arguments is not a List: $arguments");
18 for (int i = 0; i < len; i++) { 21 }
19 _arguments[i] = arguments[i]; 22 int len = arguments.length;
23 _arguments = new ObjectArray<String>(len);
24 for (int i = 0; i < len; i++) {
25 var arg = arguments[i];
26 if (arg is !String) {
27 throw new ProcessException("Non-string argument: $arg");
20 } 28 }
29 _arguments[i] = arguments[i];
21 } 30 }
31
22 _in = new _Socket._internal(); 32 _in = new _Socket._internal();
23 _out = new _Socket._internal(); 33 _out = new _Socket._internal();
24 _err = new _Socket._internal(); 34 _err = new _Socket._internal();
25 _exitHandler = new _Socket._internal(); 35 _exitHandler = new _Socket._internal();
26 _closed = false; 36 _closed = false;
27 _killed = false; 37 _killed = false;
28 _started = false; 38 _started = false;
29 _exitHandlerCallback = null; 39 _exitHandlerCallback = null;
30 } 40 }
31 41
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 Socket _in; 154 Socket _in;
145 Socket _out; 155 Socket _out;
146 Socket _err; 156 Socket _err;
147 Socket _exitHandler; 157 Socket _exitHandler;
148 int _pid; 158 int _pid;
149 bool _closed; 159 bool _closed;
150 bool _killed; 160 bool _killed;
151 bool _started; 161 bool _started;
152 var _exitHandlerCallback; 162 var _exitHandlerCallback;
153 } 163 }
OLDNEW
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698