Chromium Code Reviews| Index: lib/core/exceptions.dart |
| diff --git a/lib/core/exceptions.dart b/lib/core/exceptions.dart |
| index e6ee7ac61cb07065273da5555881591374f705ca..e6b27f251d67bde4f08c0d5decad8382313e46d4 100644 |
| --- a/lib/core/exceptions.dart |
| +++ b/lib/core/exceptions.dart |
| @@ -13,6 +13,14 @@ interface Exception default ExceptionImplementation { |
| } |
| +/** Default implementation of [Exception] which carries a message. */ |
| +class ExceptionImplementation implements Exception { |
|
Mads Ager (google)
2012/10/19 11:24:27
This doesn't seem useful in itself? Make it privat
Lasse Reichstein Nielsen
2012/10/19 12:15:04
True. It's so simple that anybody who needs the in
|
| + final message; |
| + const ExceptionImplementation([this.message]); |
| + String toString() => (message == null) ? "Exception" : "Exception: $message"; |
| +} |
| + |
| + |
| /** |
| * Exception thrown because of an index outside of the valid range. |
| */ |
| @@ -24,7 +32,6 @@ class IndexOutOfRangeException implements Exception { |
| final _value; |
| } |
| - |
| /** |
| * Exception thrown because of attempt to modify an immutable object. |
| */ |
| @@ -46,12 +53,6 @@ class ObjectNotClosureException implements Exception { |
| } |
| -class OutOfMemoryException implements Exception { |
| - const OutOfMemoryException(); |
| - String toString() => "Out of Memory"; |
| -} |
| - |
| - |
| class StackOverflowException implements Exception { |
| const StackOverflowException(); |
| String toString() => "Stack Overflow"; |