mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
34 lines
703 B
Dart
34 lines
703 B
Dart
class ServerResult {
|
|
final ServerResultType type;
|
|
final Object? error;
|
|
final StackTrace? stackTrace;
|
|
|
|
ServerResult(this.type, {this.error, this.stackTrace});
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ServerResult{type: $type, error: $error, stackTrace: $stackTrace}';
|
|
}
|
|
}
|
|
|
|
enum ServerResultType {
|
|
starting,
|
|
startSuccess,
|
|
startError,
|
|
stopping,
|
|
stopSuccess,
|
|
stopError,
|
|
missingHostError,
|
|
missingPortError,
|
|
illegalPortError,
|
|
freeingPort,
|
|
freePortSuccess,
|
|
freePortError,
|
|
pingingRemote,
|
|
pingingLocal,
|
|
pingError;
|
|
|
|
bool get isError => name.contains("Error");
|
|
|
|
bool get isSuccess => this == ServerResultType.startSuccess || this == ServerResultType.stopSuccess;
|
|
} |