ЛР2: PostgreSQL + Valkey, сессии Basic/Bearer, миграции, compose, тесты, отчёт
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""Shared error type mapped to the contract error envelope."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ApiError(Exception):
|
||||
def __init__(
|
||||
self,
|
||||
status: int,
|
||||
code: str,
|
||||
message: str,
|
||||
challenge: Optional[str] = None,
|
||||
) -> None:
|
||||
super().__init__(message)
|
||||
self.status = status
|
||||
self.code = code
|
||||
self.message = message
|
||||
# Optional WWW-Authenticate value (used by 401 responses).
|
||||
self.challenge = challenge
|
||||
Reference in New Issue
Block a user