| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import typing as t |
| 4 |
|
| 5 |
if t.TYPE_CHECKING: |
| 6 |
from ._model import Consent |
| 7 |
|
| 8 |
|
| 9 |
class ConsentParseError(Exception): |
| 10 |
"""An error raised if consent parsing/loading fails.""" |
| 11 |
|
| 12 |
def __init__(self, message: str, raw_consent: dict[str, t.Any]) -> None: |
| 13 |
super().__init__(message) |
| 14 |
self.raw_consent = raw_consent |
| 15 |
|
| 16 |
|
| 17 |
class ConsentTreeConstructionError(Exception): |
| 18 |
"""An error raised if consent tree construction fails.""" |
| 19 |
|
| 20 |
def __init__(self, message: str, consents: list[Consent]) -> None: |
| 21 |
super().__init__(message) |
| 22 |
self.consents = consents |