Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an error message when there is a std::bad_function_call #520

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions python/podio/frame_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Module defining the Frame iterator used by the Reader interface"""

# pylint: disable-next=import-error # gbl is a dynamic module from cppyy
from cppyy.gbl import std
from cppyy.gbl import std, bad_function_call
from podio.frame import Frame


Expand Down Expand Up @@ -51,7 +51,14 @@ def __getitem__(self, entry):
# If we are below 0 now, we do not have enough entries to serve the request
raise IndexError

frame_data = self._reader.readEntry(self._category, entry)
try:
frame_data = self._reader.readEntry(self._category, entry)
except bad_function_call:
print('Error: Unable to read an entry of the input file. This can happen when the '
'ROOT model dictionaries are not in LD_LIBRARY_PATH. Make sure that LD_LIBRARY_PATH '
'points to the library folder of the installation of podio and also to the library '
'folder with your data model\n')
raise
if frame_data:
return Frame(std.move(frame_data))

Expand Down