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

Side by Side Diff: sdk/lib/json/json.dart

Issue 18529003: Add stackTrace to Error object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and add bug numbers to status files. Created 7 years, 5 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 | « sdk/lib/core/errors.dart ('k') | tests/co19/co19-analyzer.status » ('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) 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 library dart.json; 5 library dart.json;
6 6
7 // JSON parsing and serialization. 7 // JSON parsing and serialization.
8 8
9 /** 9 /**
10 * Error thrown by JSON serialization if an object cannot be serialized. 10 * Error thrown by JSON serialization if an object cannot be serialized.
11 * 11 *
12 * The [unsupportedObject] field holds that object that failed to be serialized. 12 * The [unsupportedObject] field holds that object that failed to be serialized.
13 * 13 *
14 * If an object isn't directly serializable, the serializer calls the 'toJson' 14 * If an object isn't directly serializable, the serializer calls the 'toJson'
15 * method on the object. If that call fails, the error will be stored in the 15 * method on the object. If that call fails, the error will be stored in the
16 * [cause] field. If the call returns an object that isn't directly 16 * [cause] field. If the call returns an object that isn't directly
17 * serializable, the [cause] will be null. 17 * serializable, the [cause] will be null.
18 */ 18 */
19 class JsonUnsupportedObjectError implements Error { 19 class JsonUnsupportedObjectError extends Error {
20 /** The object that could not be serialized. */ 20 /** The object that could not be serialized. */
21 final unsupportedObject; 21 final unsupportedObject;
22 /** The exception thrown by object's [:toJson:] method, if any. */ 22 /** The exception thrown by object's [:toJson:] method, if any. */
23 final cause; 23 final cause;
24 24
25 JsonUnsupportedObjectError(this.unsupportedObject, { this.cause }); 25 JsonUnsupportedObjectError(this.unsupportedObject, { this.cause });
26 26
27 String toString() { 27 String toString() {
28 if (cause != null) { 28 if (cause != null) {
29 return "Calling toJson method on object failed."; 29 return "Calling toJson method on object failed.";
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 first = false; 817 first = false;
818 }); 818 });
819 sb.write('}'); 819 sb.write('}');
820 seen.removeLast(); 820 seen.removeLast();
821 return true; 821 return true;
822 } else { 822 } else {
823 return false; 823 return false;
824 } 824 }
825 } 825 }
826 } 826 }
OLDNEW
« no previous file with comments | « sdk/lib/core/errors.dart ('k') | tests/co19/co19-analyzer.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698