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

Side by Side Diff: runtime/bin/dartutils.cc

Issue 9699017: Start better error reporting for sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added tests Created 8 years, 9 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
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 #include "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "bin/file.h" 7 #include "bin/file.h"
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/globals.h" 10 #include "platform/globals.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 CObject* CObject::IllegalArgumentError() { 414 CObject* CObject::IllegalArgumentError() {
415 CObjectArray* result = new CObjectArray(CObject::NewArray(1)); 415 CObjectArray* result = new CObjectArray(CObject::NewArray(1));
416 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kIllegalArgumentError))); 416 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kIllegalArgumentError)));
417 return result; 417 return result;
418 } 418 }
419 419
420 420
421 CObject* CObject::NewOSError() { 421 CObject* CObject::NewOSError() {
422 OSError os_error; 422 OSError os_error;
423 return NewOSError(&os_error);
424 }
425
426 CObject* CObject::NewOSError(OSError* os_error) {
423 CObject* error_message = 427 CObject* error_message =
424 new CObjectString(CObject::NewString(os_error.message())); 428 new CObjectString(CObject::NewString(os_error->message()));
425 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 429 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
426 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 430 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
427 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error.code()))); 431 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
428 result->SetAt(2, error_message); 432 result->SetAt(2, error_message);
429 return result; 433 return result;
430 } 434 }
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/http_impl.dart » ('j') | runtime/bin/http_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698