mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +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}";
|
|
}
|
|
}
|