Chromium Code Reviews| Index: pkg/scheduled_test/lib/scheduled_server.dart |
| diff --git a/pkg/scheduled_test/lib/scheduled_server.dart b/pkg/scheduled_test/lib/scheduled_server.dart |
| index 8c1ad815da2ef4894087c5fcc9b38ad32212e655..b5983e42576032d022db143fca933592b1d92ce4 100644 |
| --- a/pkg/scheduled_test/lib/scheduled_server.dart |
| +++ b/pkg/scheduled_test/lib/scheduled_server.dart |
| @@ -91,8 +91,9 @@ class ScheduledServer { |
| void _handleRequest(HttpRequest request) { |
| wrapFuture(new Future.sync(() { |
| if (_handlers.isEmpty) { |
| - throw "'$description' received ${request.method} ${request.uri.path} " |
| - "when no more requests were expected."; |
| + throw new ScheduledServerError( |
| + "'$description' received ${request.method} ${request.uri.path} " |
| + "when no more requests were expected."); |
| } |
| return _handlers.removeFirst().fn(request); |
| }).catchError((e) { |
| @@ -102,3 +103,12 @@ class ScheduledServer { |
| }), 'receiving ${request.method} ${request.uri}'); |
| } |
| } |
| + |
| + |
| +class ScheduledServerError extends Error { |
|
nweiz
2013/09/19 19:56:14
I'm not a fan of using a custom error class here.
Bill Hesse
2013/09/20 13:30:20
Done.
|
| + final String message; |
| + |
| + ScheduledServerError(String this.message); |
| + |
| + String toString() => 'ScheduledServerError: $message'; |
| +} |