This commit is contained in:
lollipopkit
2023-05-26 17:01:52 +08:00
parent c1c009863d
commit 20ef9d4575
28 changed files with 126 additions and 149 deletions

View File

@@ -0,0 +1,34 @@
enum ErrFrom {
unknown,
apt,
docker,
sftp,
ssh,
status;
}
abstract class Err<T> {
final ErrFrom from;
final T type;
final String? message;
Err({required this.from, required this.type, this.message});
}
enum DockerErrType {
unknown,
noClient,
notInstalled,
invalidVersion,
cmdNoPrefix
}
class DockerErr extends Err<DockerErrType> {
DockerErr({required DockerErrType type, String? message})
: super(from: ErrFrom.docker, type: type, message: message);
@override
String toString() {
return 'DockerErr<$type>: $message';
}
}