Project

General

Profile

Development #35356

dpark: les erreurs 500 n'ont pas d'intérêt

Added by Benjamin Dauvergne 12 days ago. Updated 3 days ago.

Status:
Solution déployée
Priority:
Normal
Target version:
-
Start date:
10 Aug 2019
Due date:
% Done:

0%

Patch proposed:
Yes
Planning:
No

Description

Elles sont déjà correctement converties en APIError.

    def call(self, operation, *args, **kwargs):
        client = get_client(self)
        proxy_service = client.create_service(SERVICE_BINDING, self.operation_url)
        bypass_erroneous_reply = kwargs.pop('bypass_erroneous_reply', False)
        try:
            reply = getattr(proxy_service, operation)(*args, **kwargs)
        except (WebFault, ) as exc:
            raise APIError('ServiceError: %s' % exc.message)
        except (Exception,) as exc:
            raise APIError('Error: %s' % exc.message)
        reply_code = getattr(reply, 'CodeRetour', None) or getattr(reply, 'Code_Retour', None)
        reply_message = getattr(reply, 'MessageRetour', None) or getattr(reply, 'Lib_Retour', None)
        if reply_code != '01' and not bypass_erroneous_reply:
            raise APIError(reply_message)
        return reply

0001-dpark-do-not-log-requests-errors-35356.patch View (716 Bytes) Benjamin Dauvergne, 10 Aug 2019 04:45 PM

Associated revisions

Revision 74a4386e (diff)
Added by Benjamin Dauvergne 3 days ago

dpark: do not log requests errors (#35356)

History

#1 Updated by Benjamin Dauvergne 12 days ago

#2 Updated by Emmanuel Cazenave 3 days ago

  • Status changed from Solution proposée to Solution validée

#3 Updated by Benjamin Dauvergne 3 days ago

  • Status changed from Solution validée to Résolu (à déployer)
commit 74a4386e7040e06467902acfd590bcaa9f5d5e85
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Sat Aug 10 16:44:49 2019 +0200

    dpark: do not log requests errors (#35356)

#4 Updated by Frédéric Péters 3 days ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF