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