error property

String get error

Returns the error message.

Implementation

String get error {
  if (isSuccess) {
    throw StateError('Cannot access error when result is a success.');
  }
  return _error!;
}