dispatchError method

bool dispatchError({
  1. required String endpoint,
  2. required String method,
  3. required UuidValue methodStreamId,
  4. String? parameter,
  5. required Object error,
})

Dispatches an error to the correct stream controller.

Implementation

bool dispatchError({
  required String endpoint,
  required String method,
  required UuidValue methodStreamId,
  String? parameter,
  required Object error,
}) {
  var streamContext = _inputStreamContexts[_buildStreamKey(
    endpoint: endpoint,
    method: method,
    parameter: parameter,
    methodStreamId: methodStreamId,
  )];

  if (streamContext == null) {
    return false;
  }

  streamContext.controller.addError(error);
  return true;
}