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

Made time-error message clearer #154

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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: 8 additions & 3 deletions time_interface.r2py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def time_updatetime(localport):
None.
"""
exception_list = []

# Raise exception if TIME_IMP_DICT is empty. Otherwise proceed ahead.
if not TIME_IMP_DICT:
raise TimeError("time_updatetime called with an empty TIME_IMP_DICT. Use time_register_method to populate it!")

# try the 'update' function for each implementation, storing exceptions in
# case of total failure, and exiting the function when any of the 'update'
# functions succeed.
Expand All @@ -100,10 +105,10 @@ def time_updatetime(localport):
# Be warned that any error messages are suppressed!
return
else:
raise TimeError("time_updatetime called before time_register_method!")
# All of the update_function's raised errors. Report these exceptions to the caller.
raise TimeError('Error(s) in time_updatetime: ' + str(exception_list))

# we failed
raise TimeError('Error(s) in time_updatetime: ' + str(exception_list))




Expand Down