Files
flutter_opencode_client/lib/data/model/app/error.dart
GT610 09431a0b08 fix(pve): Fix connection issues and add more error handlings (#1081)
* feat(PVE): Added display of PVE connection loading steps

Added a detailed display of loading steps during the PVE connection process, including stages such as establishing an SSH tunnel, authentication, and data retrieval

Also optimized the sorting of PVE storage content and the logic for handling connection errors

* feat(pve): Added error handling and prompts for PVE two-factor authentication

Added error handling for PVE servers when two-factor authentication is enabled, along with relevant error types and localized prompts

* feat(PVE): Added support for PVE passwords during key-based authentication

- Added the `pvePwd` field to the `ServerCustom` model
- Added a PVE password input field to the edit page (displayed only during key-based authentication)
- Updated multilingual files to support PVE-related loading states and password prompts
- Optimized PVE connection logic to support password verification during key-based authentication
2026-03-22 16:25:48 +08:00

67 lines
1.5 KiB
Dart

import 'package:fl_lib/fl_lib.dart';
import 'package:server_box/core/extension/context/locale.dart';
enum SSHErrType { unknown, connect, auth, noPrivateKey, chdir, segements, writeScript, getStatus }
class SSHErr extends Err<SSHErrType> {
const SSHErr({required super.type, super.message});
@override
String? get solution => switch (type) {
SSHErrType.chdir => l10n.needHomeDir,
SSHErrType.auth => l10n.authFailTip,
SSHErrType.writeScript => l10n.writeScriptFailTip,
SSHErrType.noPrivateKey => l10n.noPrivateKeyTip,
_ => null,
};
}
enum ContainerErrType {
unknown,
noClient,
notInstalled,
invalidVersion,
cmdNoPrefix,
segmentsNotMatch,
parsePs,
parseImages,
parseStats,
podmanDetected,
sudoPasswordRequired,
sudoPasswordIncorrect,
}
class ContainerErr extends Err<ContainerErrType> {
const ContainerErr({required super.type, super.message});
@override
String? get solution => null;
}
enum ICloudErrType { generic, notFound, multipleFiles }
class ICloudErr extends Err<ICloudErrType> {
const ICloudErr({required super.type, super.message});
@override
String? get solution => null;
}
enum WebdavErrType { generic, notFound }
class WebdavErr extends Err<WebdavErrType> {
const WebdavErr({required super.type, super.message});
@override
String? get solution => null;
}
enum PveErrType { unknown, net, loginFailed, needTfa }
class PveErr extends Err<PveErrType> {
const PveErr({required super.type, super.message});
@override
String? get solution => null;
}