Nir Soffer has posted comments on this change.

Change subject: bridge: Make VdsmError more verbose
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.ovirt.org/#/c/37015/2/vdsm/rpc/Bridge.py
File vdsm/rpc/Bridge.py:

Line 37:         self.code = code
Line 38:         self.message = message
Line 39: 
Line 40:     def __str__(self):
Line 41:         return '%s: [error %d] %s' % (self.__class__, self.code, 
self.message)
> I think you need self.__class__.__name__
Well no, you don't need the class name at all. We get it for free from 
logging.exception(). It should behave just like other exceptions.

    return "[error %d] %s" % (self.code, self.message)

Will create this log:

    ERROR:root:Something failed
    Traceback (most recent call last):
      File "error.py", line 14, in <module>
        raise VdsmError(5, "Error description")
    VdsmError: [error 5] Error description
Line 42: 
Line 43: 
Line 44: class InvalidCall(Exception):
Line 45: 


-- 
To view, visit http://gerrit.ovirt.org/37015
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I93d41d0cf0494ed3e3a647d873bcff2f529dc2ee
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuzn...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuzn...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to