From 037b92f83363fd378c2ce44c94282dc658430a3a Mon Sep 17 00:00:00 2001 From: Jerome Martin Date: Sat, 4 Jun 2011 11:16:10 +0200 Subject: Added IOError msg to failed set attribs/params. --- rtslib/node.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rtslib/node.py b/rtslib/node.py index 13e1040..413781f 100644 --- a/rtslib/node.py +++ b/rtslib/node.py @@ -155,9 +155,10 @@ class CFSNode(object): else: try: fwrite(path, "%s\n" % str(value)) - except IOError: - raise RTSLibError("Cannot set attribute %s." - % str(attribute)) + except IOError, msg: + msg = msg[1] + raise RTSLibError("Cannot set attribute %s: %s" + % (str(attribute), str(msg))) def get_attribute(self, attribute): ''' @@ -189,9 +190,10 @@ class CFSNode(object): else: try: fwrite(path, "%s \n" % str(value)) - except IOError: - raise RTSLibError("Cannot set parameter %s." - % str(parameter)) + except IOError, msg: + msg = msg[1] + raise RTSLibError("Cannot set parameter %s: %s" + % (str(parameter), str(msg))) def get_parameter(self, parameter): ''' -- cgit v1.2.1