handleOnFailed method

Future<Resource<DataType?>> handleOnFailed(
  1. dynamic exception
)

Implementation

Future<Resource<DataType?>> handleOnFailed(dynamic exception) async {
  if (onFailed != null) return onFailed!(exception);
  Resource<DataType?> resource = Resource<DataType>.error(
      publishSubjectHasValue ? publishSubject?.value?.data : null,
      exception?.toString(),
      exception: exception);
  if (onErrorManagement != null) {
    resource = await onErrorManagement!(resource);
  }
  if (publishResults) publishSubject?.post(resource);
  return resource;
}