Module aws_lambda_powertools.event_handler.openapi.exceptions

Expand source code
from typing import Any, Sequence


class ValidationException(Exception):
    """
    Base exception for all validation errors
    """

    def __init__(self, errors: Sequence[Any]) -> None:
        self._errors = errors

    def errors(self) -> Sequence[Any]:
        return self._errors


class RequestValidationError(ValidationException):
    """
    Raised when the request body does not match the OpenAPI schema
    """

    def __init__(self, errors: Sequence[Any], *, body: Any = None) -> None:
        super().__init__(errors)
        self.body = body

Classes

class RequestValidationError (errors: Sequence[Any], *, body: Any = None)

Raised when the request body does not match the OpenAPI schema

Expand source code
class RequestValidationError(ValidationException):
    """
    Raised when the request body does not match the OpenAPI schema
    """

    def __init__(self, errors: Sequence[Any], *, body: Any = None) -> None:
        super().__init__(errors)
        self.body = body

Ancestors

class ValidationException (errors: Sequence[Any])

Base exception for all validation errors

Expand source code
class ValidationException(Exception):
    """
    Base exception for all validation errors
    """

    def __init__(self, errors: Sequence[Any]) -> None:
        self._errors = errors

    def errors(self) -> Sequence[Any]:
        return self._errors

Ancestors

  • builtins.Exception
  • builtins.BaseException

Subclasses

Methods

def errors(self) ‑> Sequence[Any]
Expand source code
def errors(self) -> Sequence[Any]:
    return self._errors