mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
very common exceptions
This commit is contained in:
@@ -24,6 +24,9 @@ from typing import Dict
|
||||
from typing import AsyncGenerator
|
||||
from typing import Type
|
||||
|
||||
from ...errors import OperationError
|
||||
from ...errors import IsBusyError
|
||||
|
||||
from .. import BasePlugin
|
||||
from .. import get_plugin_class
|
||||
|
||||
@@ -33,11 +36,11 @@ class AtxError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class AtxOperationError(AtxError):
|
||||
class AtxOperationError(OperationError, AtxError):
|
||||
pass
|
||||
|
||||
|
||||
class AtxIsBusyError(AtxOperationError):
|
||||
class AtxIsBusyError(IsBusyError, AtxError):
|
||||
def __init__(self) -> None:
|
||||
super().__init__("Performing another ATX operation, please try again later")
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ from typing import Type
|
||||
from typing import AsyncGenerator
|
||||
from typing import Optional
|
||||
|
||||
from ...errors import OperationError
|
||||
from ...errors import IsBusyError
|
||||
|
||||
from .. import BasePlugin
|
||||
from .. import get_plugin_class
|
||||
|
||||
@@ -36,10 +39,15 @@ class MsdError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class MsdOperationError(MsdError):
|
||||
class MsdOperationError(OperationError, MsdError):
|
||||
pass
|
||||
|
||||
|
||||
class MsdIsBusyError(IsBusyError, MsdError):
|
||||
def __init__(self) -> None:
|
||||
super().__init__("Performing another MSD operation, please try again later")
|
||||
|
||||
|
||||
class MsdOfflineError(MsdOperationError):
|
||||
def __init__(self) -> None:
|
||||
super().__init__("MSD is not found")
|
||||
@@ -70,11 +78,6 @@ class MsdImageExistsError(MsdOperationError):
|
||||
super().__init__("This image is already exists")
|
||||
|
||||
|
||||
class MsdIsBusyError(MsdOperationError):
|
||||
def __init__(self) -> None:
|
||||
super().__init__("Performing another MSD operation, please try again later")
|
||||
|
||||
|
||||
class MsdMultiNotSupported(MsdOperationError):
|
||||
def __init__(self) -> None:
|
||||
super().__init__("This MSD does not support storing multiple images")
|
||||
|
||||
@@ -48,13 +48,13 @@ from .... import aiotools
|
||||
from .... import aioregion
|
||||
|
||||
from .. import MsdError
|
||||
from .. import MsdIsBusyError
|
||||
from .. import MsdOfflineError
|
||||
from .. import MsdConnectedError
|
||||
from .. import MsdDisconnectedError
|
||||
from .. import MsdImageNotSelected
|
||||
from .. import MsdUnknownImageError
|
||||
from .. import MsdImageExistsError
|
||||
from .. import MsdIsBusyError
|
||||
from .. import BaseMsd
|
||||
|
||||
from . import fs
|
||||
|
||||
@@ -53,10 +53,10 @@ from ...validators.os import valid_abs_path
|
||||
from ...validators.hw import valid_gpio_pin
|
||||
|
||||
from . import MsdError
|
||||
from . import MsdIsBusyError
|
||||
from . import MsdOfflineError
|
||||
from . import MsdConnectedError
|
||||
from . import MsdDisconnectedError
|
||||
from . import MsdIsBusyError
|
||||
from . import MsdMultiNotSupported
|
||||
from . import MsdCdromNotSupported
|
||||
from . import BaseMsd
|
||||
|
||||
Reference in New Issue
Block a user