Projet

Général

Profil

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

Valentin Deniaud, 03 juin 2020 11:02

Télécharger (1,1 ko)

Voir les différences:

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

 passerelle/utils/jsonresponse.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 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
    def __init__(self, *args, **kwargs):
35
    def __init__(self, *args, err=1, log_error=False, http_status=200, **kwargs):
36
        self.err = err
37
        self.log_error = log_error
38
        self.http_status = http_status
39 39
        self.__dict__.update(kwargs)
40 40
        super(APIError, self).__init__(*args)
41 41

  
42
-