From 8db73b7d0ff6fb1d14794da26e8ea656aab78d4a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 9 Nov 2019 20:08:46 +0100 Subject: Make Python exceptions more informative --- bindings/python/lilv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bindings') diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py index 70fb79f..c548e98 100644 --- a/bindings/python/lilv.py +++ b/bindings/python/lilv.py @@ -915,7 +915,7 @@ class Collection(Structure): it = self.iter_next(self.collection, it) pos = pos + 1 - raise IndexError + raise IndexError(index) def begin(self): return self.__iter__() @@ -957,7 +957,7 @@ class Plugins(Collection): plugin = self.get_by_uri(key) if plugin is None: - raise KeyError + raise KeyError("Plugin not found: " + str(key)) return plugin @@ -1004,7 +1004,7 @@ class PluginClasses(Collection): klass = self.get_by_uri(key) if klass is None: - raise KeyError + raise KeyError("Plugin class not found: " + str(key)) return klass @@ -1054,7 +1054,7 @@ class UIs(Collection): ui = self.get_by_uri(key) if ui is None: - raise KeyError + raise KeyError("Plugin UI not found: " + str(key)) return ui -- cgit v1.2.1