gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

ForbiddenException

Generic exception to throw a 403 forbidden error useful for any kind of error

Attributes
detail: strdetail_args: Dictheaders: Dictinstance_id: strshow_as: Literalunique_code: str
Functions
__init__

Throw a generic exception

detail : str
Human redable message of the error
unique_code : str
Unique code to recognize the error, if not provided, a code is generated with filename and method name (that raised the exception)
detail_args : Dict
if provided, it replace the arg in the detail message (between double bracket {{}}) with the corresponding dict value
headers : Dict
if specific header need to be returned in the HTTP response
instance_id : str
Unique id for this exception instance. Only provide when it was generated by another exception
get_detail_with_args

Replace the arguments in the exception message with dict corresponding values For example : detail = 'Hello {{name}}' and detail_args = {"name" : "Bob"}, the message that will be show will be 'Hello bob'

Return type : str