BaseError.fromError constructor

BaseError.fromError(
  1. Object error,
  2. StackTrace stackTrace
)

Converts Object error to BaseError

Implementation

factory BaseError.fromError(
  Object error,
  StackTrace stackTrace,
) {
  if (error is ApiException) {
    return BaseError.fromApiException(error);
  }
  return BaseError.fromApiException(
    handleCommonError(
      error,
      stackTrace,
    ),
  );
}