dataOrThrow property

T get dataOrThrow

Get data or throw error

Implementation

T get dataOrThrow {
  if (isSuccess && data != null) {
    return data!;
  } else if (error != null) {
    throw error!;
  } else {
    throw ApiException.custom(
      message: 'No data available',
      type: ApiExceptionType.unknown,
    );
  }
}