responseError method

void responseError(
  1. int id, {
  2. int? code,
  3. String? reason,
  4. String? message,
})

Implementation

void responseError(int id, {int? code, String? reason, String? message}) {
  var request = requests.value.firstWhereOrNull((n) => n.id == id);
  if (request != null) {
    request.watch.stop();

    request.errorResponse = ErrorResponse(
        code: code ?? 400, reason: reason ?? '', message: message ?? '');

    requests.add(requests.value);
  }
}