| Index: pkg/json_rpc_2/test/server/server_test.dart
|
| diff --git a/pkg/json_rpc_2/test/server/server_test.dart b/pkg/json_rpc_2/test/server/server_test.dart
|
| index fc3adb527efc8783374632b612ba3cf7e614a02e..c18a8caeb89cc0596a5a1b5784bd0d102561115c 100644
|
| --- a/pkg/json_rpc_2/test/server/server_test.dart
|
| +++ b/pkg/json_rpc_2/test/server/server_test.dart
|
| @@ -92,6 +92,22 @@ void main() {
|
| }), completion(isNull));
|
| });
|
|
|
| + test("includes the error data in the response", () {
|
| + server.registerMethod('foo', (params) {
|
| + throw new json_rpc.RpcException(5, 'Error message.', data: 'data value');
|
| + });
|
| +
|
| + expectErrorResponse(server, {
|
| + 'jsonrpc': '2.0',
|
| + 'method': 'foo',
|
| + 'params': {},
|
| + 'id': 1234
|
| + },
|
| + 5,
|
| + 'Error message.',
|
| + data: 'data value');
|
| + });
|
| +
|
| group("JSON", () {
|
| test("handles a request parsed from JSON", () {
|
| server.registerMethod('foo', (params) {
|
|
|