-
Notifications
You must be signed in to change notification settings - Fork 217
Open
Description
In case a symbol isn't found by the DataAccess.get_data() function, an error code should be returned to raise an exception.
>>> try:
... c_dataobj.get_data(ldt_timestamps, ['OOMP'], ls_keys)[0]
... except:
... logging.error('symbol not found')
Currently only a message is displayed, and NaNs are returned for the symbol in case:
Did not find path to OOMP. Looks like this file is missing
OOMP
2011-01-10 16:00:00 NaN
2011-01-11 16:00:00 NaN
(...) output ommitted
Suggested solution
In case a symbol is not found, return a non-zero exit code:
return 1
Or even better, raise an exception:
try:
do_something(101)
except ValueError, e:
print 'Did not find symbol ', symbol, 'error:', str(e)
Metadata
Metadata
Assignees
Labels
No labels