stack_wallet/lib/services/buy/buy_response.dart
2023-01-14 08:21:32 -06:00

24 lines
472 B
Dart

enum BuyExceptionType { generic, serializeResponseError }
class BuyException implements Exception {
String errorMessage;
BuyExceptionType type;
BuyException(this.errorMessage, this.type);
@override
String toString() {
return errorMessage;
}
}
class BuyResponse<T> {
final T? value;
final BuyException? exception;
BuyResponse({this.value, this.exception});
@override
String toString() {
return "{error: $exception, value: $value}";
}
}