Put all exceptions in their dedicated module.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
# Copyright (C) 2026 Frédéric Tronel
|
||||
|
||||
|
||||
from typing import IO
|
||||
|
||||
from typeguard import typechecked
|
||||
|
||||
class TSCutError(Exception):
|
||||
"""Base exception for tscut."""
|
||||
|
||||
|
||||
class MissingToolError(TSCutError):
|
||||
"""Raised when a required external tool is unavailable."""
|
||||
|
||||
|
||||
class ExternalToolError(TSCutError):
|
||||
"""Raised when an external tool fails."""
|
||||
|
||||
|
||||
class InvalidMediaError(TSCutError):
|
||||
"""Raised when input media cannot be processed."""
|
||||
@@ -8,10 +8,10 @@ from shutil import which
|
||||
|
||||
from typeguard import typechecked
|
||||
|
||||
from tscut.exceptions import MissingToolError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class MissingToolError(Exception):
|
||||
pass
|
||||
|
||||
@typechecked
|
||||
def check_required_tools() -> tuple[bool,dict[str,str]]:
|
||||
|
||||
Reference in New Issue
Block a user