alti_api.versions.v1_0.exceptions module

Exceptions that can be returned from the API

exception alti_api.versions.v1_0.exceptions.ErrorException(status_code: int, content: str, media_type: str)

Bases : Exception

Customize the code and the content of the exception

__init__(status_code: int, content: str, media_type: str)
async alti_api.versions.v1_0.exceptions.format_exception_content(content: str, invalid_parameter: str, invalid_value: str, cause: str = '', indent: boolean_enum = Query(boolean_enum.false), output_format: format_enum = Query(format_enum.json))

Format exception content

Paramètres:
  • content – Content of the exception not formatted

  • invalid_parameter – Name of the invalid parameter

  • invalid_value – Value invalid

  • indent – Value of the indent parameter

  • output_format – Value of the format parameter

Renvoie:

Content of the formatted exception

async alti_api.versions.v1_0.exceptions.get_exception_content(invalid_parameter: str, output_format: format_enum = Query(format_enum.json), indent: boolean_enum = Query(boolean_enum.false))

Get the error content associated with the invalid parameter

Paramètres:
  • invalid_parameter – Name of the invalid parameter

  • output_format – Value of the format parameter

  • indent – Value of the indent parameter

Renvoie:

Content of the exception, format and indent parameters values

async alti_api.versions.v1_0.exceptions.validation_exception_handler(request: Request, exc: RequestValidationError, invalid_parameter: str, resource_prefix: str) PlainTextResponse

Returns an pydantic exception with custom code and content

Paramètres:
  • request – Request

  • exc – RequestValidationError

  • invalid_parameter – Name of the invalid parameter

  • resource_prefix – Prefix of the resource endpoints

Renvoie:

PlainTextResponse