Chromium Code Reviews| Index: sdk/lib/_internal/lib/isolate_helper.dart |
| diff --git a/sdk/lib/_internal/lib/isolate_helper.dart b/sdk/lib/_internal/lib/isolate_helper.dart |
| index af5c9d55185f39e4c96c4ea28a46acce19f6f987..39ba791b17fcca66e9ceb8fa8876b9a9d23075f3 100644 |
| --- a/sdk/lib/_internal/lib/isolate_helper.dart |
| +++ b/sdk/lib/_internal/lib/isolate_helper.dart |
| @@ -23,6 +23,13 @@ import 'dart:_interceptors' show JSExtendableArray; |
| ReceivePort controlPort; |
| +class IsolateDeserializationError extends Error { |
| + final String _message; |
| + IsolateDeserializationError(this._message); |
| + |
| + toString() => "IsolateDeserializationError: $_message"; |
| +} |
| + |
| /** |
| * Called by the compiler to support switching |
| * between isolates when we get a callback from the DOM. |
| @@ -1077,8 +1084,7 @@ class _MessageTraverser { |
| visitSendPort(SendPort x); |
| visitObject(Object x) { |
| - // TODO(floitsch): make this a real exception. (which one)? |
| - throw "Message serialization: Illegal value $x passed"; |
| + throw new IsolateMessageException("Illegal value $x passed"); |
|
Lasse Reichstein Nielsen
2013/12/11 10:38:28
Could we put the value of x into the object?
If th
floitsch
2013/12/11 12:14:16
Yes. I would like that.
The problem is that it wou
|
| } |
| static bool isPrimitive(x) { |
| @@ -1233,8 +1239,7 @@ class _Deserializer { |
| deserializeSendPort(List x); |
| deserializeObject(List x) { |
| - // TODO(floitsch): Use real exception (which one?). |
| - throw "Unexpected serialized object"; |
| + throw new IsolateDeserializationError("Unexpected serialized object"); |
|
Lasse Reichstein Nielsen
2013/12/11 10:38:28
How does this error occur?
It happens during dese
floitsch
2013/12/11 12:14:16
It's a sanity check, and could happen once we have
|
| } |
| } |