ServiceExtensionResponse.error constructor

  1. int errorCode,
  2. String errorDetail

Creates an error response to a service protocol extension RPC.

Requires errorCode to be invalidParams or between extensionErrorMin and extensionErrorMax. Requires errorDetail to be a JSON object encoded as a string. When forming the JSON-RPC message errorDetail will be inlined directly.


ServiceExtensionResponse.error(int errorCode, String errorDetail)
    : result = null,
      errorCode = errorCode,
      errorDetail = errorDetail {
  // TODO: When NNBD is complete, delete the following line.
  checkNotNullable(errorDetail, "errorDetail");