Back to bricks list
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

ExceptionHandler

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

Functions
GENERATE_INSTANCE_ID - @classmethod
Return type : str
GENERATE_UNIQUE_CODE_FROM_EXCEPTION - @classmethod

Generate a unique exception code from the stack trace

Return type : str
GET_UNIQUE_CODE_FOR_BRICK - @classmethod

Convert the code to a unique code by adding the brick name before the code

Code : str
exception code
Return type : str
HANDLE_EXCEPTION - @classmethod
request : Request
exception : Exception
Return type : ExceptionResponse
HANDLE_REQUEST_VALIDATION_ERROR - @classmethod

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

exc : RequestValidationError
UNIQUE_CODE_SEPARATOR - @classmethod
Return type : str