Конструктор ServiceExtensionResponse.error
ServiceExtensionResponse.error(Создаёт ответ об ошибке на вызов RPC расширения протокола сервиса.
Требуется errorCode быть invalidParams или находиться в диапазоне от extensionErrorMin до extensionErrorMax. Требуется errorDetail быть JSON-объектом, закодированным в строку. При формировании JSON-RPC сообщения errorDetail будет вставлено непосредственно.
Исходный код
ServiceExtensionResponse.error(int errorCode, String errorDetail)
: _result = null,
_errorCode = errorCode,
_errorDetail = errorDetail {
_validateErrorCode(_errorCode);
if (_errorDetail is! String) {
throw new ArgumentError.value(
_errorDetail, "errorDetail", "Must be a String");
}
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-developer/ServiceExtensionResponse/ServiceExtensionResponse.error.html