Projet

Général

Profil

0001-utils-allow-changing-APIError-attributes-38721.patch

Valentin Deniaud, 03 juin 2020 11:55

Télécharger (1,07 ko)

Voir les différences:

Subject: [PATCH 1/2] utils: allow changing APIError attributes (#38721)

 passerelle/utils/jsonresponse.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
passerelle/utils/jsonresponse.py
31 31

  
32 32
class APIError(RuntimeError):
33 33
    '''Exception to raise when there is a remote application or business logic error.'''
34
    err = 1
35
    log_error = False
36
    http_status = 200
37 34

  
38 35
    def __init__(self, *args, **kwargs):
36
        self.err = kwargs.pop('err', 1)
37
        self.log_error = kwargs.pop('log_error', False)
38
        self.http_status = kwargs.pop('http_status', 200)
39 39
        self.__dict__.update(kwargs)
40 40
        super(APIError, self).__init__(*args)
41 41

  
42
-