Hi,

I was hacking around the media file tagging code a bit (maybe more about
that later when I actually have some working code to show) and I noticed
that if you try to use a config variable which doesn't exist,
config.py's __getattr__ just raises an AttributeError without a message.

If you happen to try to use a non-existing config variable inside a
try-catch where you catch Exception and then log its message, the
resulting error message isn't going to be very helpful when the caught
Exception itself has no message.

The attached patch adds a simple message to the AttributeError which is
raised by config.py if a non-existing config variable is attempted to be
used.


-- 
Ville-Pekka Vainio
diff --git a/src/gpodder/config.py b/src/gpodder/config.py
index 7eeb0db..80d9b6c 100644
--- a/src/gpodder/config.py
+++ b/src/gpodder/config.py
@@ -179,7 +179,7 @@ class Config(dict):
             ( fieldtype, default ) = self.Settings[name]
             return self[name]
         else:
-            raise AttributeError
+            raise AttributeError( '%s is not a setting' % name)
 
     def add_observer(self, callback):
         """
_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel

Reply via email to