Skip to content

Commit

Permalink
include object/uri info in error description when nothing is exposed.…
Browse files Browse the repository at this point in the history
… Fixes # 97
  • Loading branch information
irmen committed Oct 13, 2024
1 parent 0522fe0 commit 9c2e42d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Pyro5/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion Pyro5/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9c2e42d

Please sign in to comment.