LocusError.fromException constructor

LocusError.fromException(
  1. Object error, [
  2. StackTrace? stack
])

Creates from a generic exception.

Implementation

factory LocusError.fromException(Object error, [StackTrace? stack]) {
  if (error is LocusError) return error;

  return LocusError(
    type: LocusErrorType.unknown,
    message: error.toString(),
    originalError: error,
    stackTrace: stack,
  );
}