mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-25 12:59:24 +00:00
24 lines
517 B
Dart
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}";
|
|
}
|
|
}
|