Chromium Code Reviews| Index: sdk/lib/core/errors.dart |
| diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart |
| index c11ea2e1a97da25e0c73490a216d7ec025492dc6..8e7710889f9fce774d92a209b054f00e50033325 100644 |
| --- a/sdk/lib/core/errors.dart |
| +++ b/sdk/lib/core/errors.dart |
| @@ -120,6 +120,24 @@ class NullThrownError extends Error { |
| } |
| /** |
| + * Error thrown when attempting to dereference [:null:]. |
| + */ |
| +class NullDereferenceError extends Error implements NoSuchMethodError { |
|
rmacnak
2016/10/10 21:29:39
DBC: Don't make this type public.
sra1
2016/10/10 21:50:40
This class also throws away information. You can't
sra1
2016/10/10 21:50:40
Yes, please remove from corelib.
We can't reliably
|
| + /** Message describing the problem. */ |
| + final message; |
| + |
| + /** |
| + * The [message] optionally describes the circumstances |
| + * under which [:null:] was dereferenced. |
| + */ |
| + NullDereferenceError([this.message]); |
| + |
| + String toString() { |
| + return "Cannot dereference null.${ message != null ? ' $message' : ''}"; |
|
rmacnak
2016/10/10 21:29:39
DBC: There is no such operation as "dereferencing"
sra1
2016/10/10 21:50:40
Still use the 'no such method' terminology.
This
|
| + } |
| +} |
| + |
| +/** |
| * Error thrown when a function is passed an unacceptable argument. |
| */ |
| class ArgumentError extends Error { |