Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
2
Share

ExceptionHandler

Class to handle exceptions and return a formatted object to the front

Functions
generate_instance_id @classmethod
Return type : str
handle_exception @classmethod

Convert an exception to a formatted ExceptionResponse.

request : starlette.requests.Request | None
exception : Exception
cors_policy : gws_core.core.classes.cors_config.CorsPolicy | None
Return type : ExceptionResponse
handle_request_validation_error @classmethod

Handle a RequestValidationError exception (error 422 Unprocessable Entity) It returns only the first message

exc : RequestValidationError
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.