stack_wallet/lib/services/exchange/exchange_response.dart
2022-10-02 13:37:11 -06:00

24 lines
517 B
Dart

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