Project

General

Profile

Actions

Bug #2840

closed

Handle exceptions properly in the library

Added by susmit shannigrahi over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
05/27/2015
Due date:
% Done:

0%

Estimated time:

Description

[susmit@atmos-lbl tools]$ python3 insert_names.py
File/directory to translate: /raid/dart/cmip5.atmos.rcp85.6hr/
Schema file path for the above file/directory: /root/ndn-atmos/lib/ndn_cmmap_translators/etc/cmip5/cmip5.conf
config file '/root/ndn-atmos/lib/ndn_cmmap_translators/etc/cmip5/cmip5.conf', data path '/raid/dart/cmip5.atmos.rcp85.6hr/'
/root/ndn-atmos/lib/ndn_cmmap_translators/etc/cmip5/cmip5.conf
{}
Traceback (most recent call last):
File "/home/susmit/ndn-atmos/lib/ndn_cmmap_translators/atmos2ndn_parser/conf_file_parser.py", line 66, in getMappings
self.filenameMap = self.fullConf['Name']['filenameMapping'].replace(" ", "").split(',')
KeyError: 'Name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insert_names.py", line 102, in
ndnNames = atmos_translator.argsForTranslation(datafilePath, configFilepath)
File "/home/susmit/ndn-atmos/lib/ndn_cmmap_translators/atmos_translator.py", line 37, in argsForTranslation
res = parsedConfig.getMappings()
File "/home/susmit/ndn-atmos/lib/ndn_cmmap_translators/atmos2ndn_parser/conf_file_parser.py", line 81, in getMappings
raise error.with_traceback(sys.exc_info()[2])
NameError: global name 'error' is not defined

Actions

Also available in: Atom PDF