16 lines
589 B
Dart
16 lines
589 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'catalog_failure.freezed.dart';
|
|
|
|
/// Expected failures of catalog calls (Spec #3 § 5.2).
|
|
@freezed
|
|
sealed class CatalogFailure with _$CatalogFailure {
|
|
/// No connection or timeout.
|
|
const factory CatalogFailure.network() = CatalogNetworkFailure;
|
|
|
|
/// The backend rejected the input (`P0001`). The app prevents this at input
|
|
/// time, so it is a programming error.
|
|
const factory CatalogFailure.invalidInput() = CatalogInvalidInputFailure;
|
|
|
|
const factory CatalogFailure.unexpected() = CatalogUnexpectedFailure;
|
|
}
|