mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 10:01:53 +08:00
very common exceptions
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user