openapi-nexus 0.1.6

OpenAPI 3.x multi-language code generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
"""API error type."""

from __future__ import annotations


class ApiError(Exception):
    """Raised when the server returns a 4xx or 5xx status code."""

    def __init__(self, status_code: int, status: str, body: bytes) -> None:
        self.status_code = status_code
        self.status = status
        self.body = body
        super().__init__(f"{status_code} {status}")