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

Side by Side Diff: sdk/lib/io/process.dart

Issue 11417028: Include command in ProcessException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
OLDNEW
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 // TODO(ager): The only reason for this class is that we 5 // TODO(ager): The only reason for this class is that we
6 // cannot patch a top-level at this point. 6 // cannot patch a top-level at this point.
7 class _ProcessUtils { 7 class _ProcessUtils {
8 external static _exit(int status); 8 external static _exit(int status);
9 } 9 }
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 static const ProcessSignal SIGPROF = const ProcessSignal._signal(27); 207 static const ProcessSignal SIGPROF = const ProcessSignal._signal(27);
208 static const ProcessSignal SIGPOLL = const ProcessSignal._signal(29); 208 static const ProcessSignal SIGPOLL = const ProcessSignal._signal(29);
209 static const ProcessSignal SIGSYS = const ProcessSignal._signal(31); 209 static const ProcessSignal SIGSYS = const ProcessSignal._signal(31);
210 210
211 const ProcessSignal._signal(int this._signalNumber); 211 const ProcessSignal._signal(int this._signalNumber);
212 final int _signalNumber; 212 final int _signalNumber;
213 } 213 }
214 214
215 215
216 class ProcessException implements Exception { 216 class ProcessException implements Exception {
217 const ProcessException([String this.message = "", int this.errorCode = 0]); 217 const ProcessException([String this.command = "",
218 String toString() => "ProcessException: $message ($errorCode)"; 218 String this.message = "",
219 int this.errorCode = 0]);
220 String toString() {
221 var msg = (message == null) ? 'OS error code: $errorCode' : message;
222 return "ProcessException: $msg\n Command: $command";
223 }
224
225 /**
226 * Contains the command for this process.
227 */
228 final String command;
219 229
220 /** 230 /**
221 * Contains the system message for the process exception if any. 231 * Contains the system message for the process exception if any.
222 */ 232 */
223 final String message; 233 final String message;
224 234
225 /** 235 /**
226 * Contains the OS error code for the process exception if any. 236 * Contains the OS error code for the process exception if any.
227 */ 237 */
228 final int errorCode; 238 final int errorCode;
229 } 239 }
OLDNEW
« runtime/bin/process_patch.dart ('K') | « runtime/bin/process_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698