OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library protocol; | 5 library protocol; |
6 | 6 |
7 import 'dart:convert' show JsonDecoder; | 7 import 'dart:convert' show JsonDecoder; |
8 | 8 |
9 /** | 9 /** |
10 * Instances of the class [Request] represent a request that was received. | 10 * Instances of the class [Request] represent a request that was received. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 * by a [request] referencing a context that does not exist. | 218 * by a [request] referencing a context that does not exist. |
219 */ | 219 */ |
220 Response.contextDoesNotExist(Request request) | 220 Response.contextDoesNotExist(Request request) |
221 : this(request.id, new RequestError(-1, 'Context does not exist')); | 221 : this(request.id, new RequestError(-1, 'Context does not exist')); |
222 | 222 |
223 /** | 223 /** |
224 * Initialize a newly created instance to represent an error condition caused | 224 * Initialize a newly created instance to represent an error condition caused |
225 * by a [request] that was expected to have a boolean-valued parameter but was | 225 * by a [request] that was expected to have a boolean-valued parameter but was |
226 * passed a non-boolean value. | 226 * passed a non-boolean value. |
227 */ | 227 */ |
228 Response.expectedBoolean(Request request, String value) | 228 Response.expectedBoolean(Request request, Object value) |
229 : this(request.id, new RequestError(-2, 'Expected a boolean value, but found
"$value"')); | 229 : this(request.id, new RequestError(-2, 'Expected a boolean value, but found
"$value"')); |
230 | 230 |
231 /** | 231 /** |
232 * Initialize a newly created instance to represent an error condition caused | 232 * Initialize a newly created instance to represent an error condition caused |
233 * by a [request] that was expected to have a integer-valued parameter but was | 233 * by a [request] that was expected to have a integer-valued parameter but was |
234 * passed a non-integer value. | 234 * passed a non-integer value. |
235 */ | 235 */ |
236 Response.expectedInteger(Request request, String value) | 236 Response.expectedInteger(Request request, Object value) |
237 : this(request.id, new RequestError(-3, 'Expected an integer value, but foun
d "$value"')); | 237 : this(request.id, new RequestError(-3, 'Expected an integer value, but foun
d "$value"')); |
238 | 238 |
239 /** | 239 /** |
240 * Initialize a newly created instance to represent an error condition caused | 240 * Initialize a newly created instance to represent an error condition caused |
241 * by a malformed request. | 241 * by a malformed request. |
242 */ | 242 */ |
243 Response.invalidRequestFormat() | 243 Response.invalidRequestFormat() |
244 : this('', new RequestError(-4, 'Invalid request')); | 244 : this('', new RequestError(-4, 'Invalid request')); |
245 | 245 |
246 /** | 246 /** |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 /** | 584 /** |
585 * The response to be returned as a result of the failure. | 585 * The response to be returned as a result of the failure. |
586 */ | 586 */ |
587 final Response response; | 587 final Response response; |
588 | 588 |
589 /** | 589 /** |
590 * Initialize a newly created exception to return the given reponse. | 590 * Initialize a newly created exception to return the given reponse. |
591 */ | 591 */ |
592 RequestFailure(this.response); | 592 RequestFailure(this.response); |
593 } | 593 } |
OLD | NEW |