-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathexception.py
More file actions
27 lines (19 loc) · 804 Bytes
/
Copy pathexception.py
File metadata and controls
27 lines (19 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
### IMPORTS
### ============================================================================
## Future
from __future__ import annotations
## Standard Library
## Installed
## Application
### CLASSES
### ============================================================================
class PythonJsonLoggerError(Exception):
"Generic base clas for all Python JSON Logger exceptions"
class MissingPackageError(ImportError, PythonJsonLoggerError):
"A required package is missing"
def __init__(self, name: str, extras_name: str | None = None) -> None:
msg = f"The {name!r} package is required but could not be found."
if extras_name is not None:
msg += f" It can be installed using 'python-json-logger[{extras_name}]'."
super().__init__(msg)
return