Skip to content
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