Skip to content

catch_startup_validation_error

faststream.app.catch_startup_validation_error async #

catch_startup_validation_error()
Source code in faststream/app.py
@asynccontextmanager
async def catch_startup_validation_error() -> AsyncIterator[None]:
    try:
        yield
    except PValidation as e:
        fields = [str(x["loc"][0]) for x in e.errors()]
        raise ValidationError(fields=fields) from e