From 9c2e42d50976c9a67e9f843779f14d6c83964e31 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 13 Oct 2024 15:45:40 +0200 Subject: [PATCH] include object/uri info in error description when nothing is exposed. Fixes # 97 --- Pyro5/client.py | 2 +- Pyro5/server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pyro5/client.py b/Pyro5/client.py index f71eadf..ee0e599 100644 --- a/Pyro5/client.py +++ b/Pyro5/client.py @@ -413,7 +413,7 @@ def __processMetadata(self, metadata): log.debug("from meta: methods=%s, oneway methods=%s, attributes=%s", sorted(self._pyroMethods), sorted(self._pyroOneway), sorted(self._pyroAttrs)) if not self._pyroMethods and not self._pyroAttrs: - raise errors.PyroError("remote object doesn't expose any methods or attributes. Did you forget setting @expose on them?") + raise errors.PyroError("remote object '%s' doesn't expose any methods or attributes. Did you forget setting @expose on them?" % self._pyroUri) def _pyroReconnect(self, tries=100000000): """ diff --git a/Pyro5/server.py b/Pyro5/server.py index be6750e..5db2331 100644 --- a/Pyro5/server.py +++ b/Pyro5/server.py @@ -168,7 +168,7 @@ def get_metadata(self, objectId): metadata = _get_exposed_members(obj) if not metadata["methods"] and not metadata["attrs"]: # Something seems wrong: nothing is remotely exposed. - warnings.warn("Class %r doesn't expose any methods or attributes. Did you forget setting @expose on them?" % type(obj)) + warnings.warn("Class %s doesn't expose any methods or attributes. Did you forget setting @expose on them?" % repr(obj)) return metadata else: log.debug("unknown object requested: %s", objectId)