Bug #31

GCvs load exception is not catched

Added by Knödlseder Jürgen about 12 years ago. Updated about 9 years ago.

Status:ClosedStart date:02/20/2012
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.0.0
Duration:

Description

When the GCvs constructor loads a file through the load constructor and the file does not exist, the exception that is thrown does not show up.

Note that this is a pretty old bug which I moved over from the FusionForge database, and it is not clear whether this bug does still exist.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 9 years ago

  • Status changed from New to Closed
  • Assigned To set to Knödlseder Jürgen
  • Target version set to 1.0.0
  • % Done changed from 0 to 100

Trying actually under Python:

$ python
>>> import gammalib
>>> csv=gammalib.GCsv("this_file_does_not_exist.csv")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/gamma/lib/python2.6/site-packages/gammalib/support.py", line 503, in __init__
    this = _support.new_GCsv(*args)
RuntimeError: *** ERROR in GCsv::load(std::string&, std::string&): File "this_file_does_not_exist.csv" not found.

and
>>> csv=gammalib.GCsv()
>>> csv.load("this_file_does_not_exist.csv")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/gamma/lib/python2.6/site-packages/gammalib/support.py", line 565, in load
    return _support.GCsv_load(self, *args)
RuntimeError: *** ERROR in GCsv::load(std::string&, std::string&): File "this_file_does_not_exist.csv" not found.

And also in C++:

$ ./csv 
terminate called after throwing an instance of 'GException::file_not_found'
  what():  *** ERROR in GCsv::load(std::string&, std::string&): File "this_file_does_not_exist.csv" not found.
Abort trap

So the issue is closed.

Also available in: Atom PDF