Source code for doot.errors._base

 1#!/usr/bin/env python3
 2"""
 3
 4
 5
 6"""
 7# Import:
 8from __future__ import annotations
 9
10# ##-- stdlib imports
11import logging as logmod
12from typing import (TYPE_CHECKING, Any, Callable, ClassVar, Final, Generator,
13                    Generic, Iterable, Iterator, Mapping, Match,
14                    MutableMapping, Protocol, Sequence, Tuple, TypeAlias,
15                    TypeGuard, TypeVar, cast, final, overload,
16                    runtime_checkable)
17
18# ##-- end stdlib imports
19
20from typing import override
21
22##-- logging
23logging = logmod.getLogger(__name__)
24##-- end logging
25
26# ##-- Generated Exports
27__all__ = ( # noqa: RUF022
28
29# -- Classes
30"BackendError", "DootError", "FrontendError", "UserError",
31
32)
33# ##-- end Generated Exports
34
35# Global Vars:
36
37# Body:
[docs] 38class DootError(Exception): 39 """ 40 The base class for all Doot Errors 41 will try to % format the first argument with remaining args in str() 42 """ 43 general_msg : str = "Non-Specific Doot Error:" 44 45 @override 46 def __str__(self): 47 try: 48 return self.args[0] % self.args[1:] 49 except TypeError: 50 return str(self.args)
51 52
[docs] 53class BackendError(DootError): 54 pass
55
[docs] 56class FrontendError(DootError): 57 pass
58
[docs] 59class UserError(DootError): 60 pass