Back To Overview

Catch Exception from Python
Posted on 10 Aug, 2018 by SergioBruni

| Dear All I have installed GPSTK v2.10 and I use it from python 2.7.12 Using readRinex3Obs function, I tried to catch exception but, when the content of filename is not correct, my python script ends printing following error message: "terminate called after throwing an instance of 'gpstk::Exception'"

After reading documentation I wrote following code:

=================

try:

header, data = gpstk.readRinex3Obs(filename)

except gpstk.exceptions.InvalidRequest:

print 'Could not process data.'

=================

or ...

=================

try:

header, data = gpstk.readRinex3Obs(filename)

except gpstk.exceptions.InvalidRequest:

print 'Could not process data.'

=================

The function that crashes is readHeader inside gpstk.py module, when it try to call: _gpstk.Rinex3ObsStream_readHeader(self)

Does anybody knows what I'm missing?

Thanks

Sergio Bruni

|

Add your comments to the Discussion
 


#ComMents
Topic revision: r1 - 10 Aug 2018, SergioBruni
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback