From ca8081b7aad97289acc898e705b5c4c28b7d4637 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Wed, 22 Apr 2015 12:38:10 +0200 Subject: [PATCH] debugging: return the exception text whenever an error occurs - makes debugging much easier --- pylot/core/read/data.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 874c7aac..a67cc8a9 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -3,15 +3,13 @@ import os -import numpy as np from obspy.core import (read, Stream, UTCDateTime) from obspy import readEvents from obspy.core.event import (Event, Catalog) from pylot.core.read import readPILOTEvent - -from pylot.core.util import fnConstructor, createEvent, FormatError, \ - prepTimeAxis, getGlobalTimes +from pylot.core.util import fnConstructor, FormatError, \ + getGlobalTimes class Data(object): @@ -129,8 +127,8 @@ class Data(object): except TypeError: try: self.wfdata += read(fname, format='GSE2') - except Exception: - warnmsg += '{0}\n'.format(fname) + except Exception, e: + warnmsg += '{0}\n{1}\n'.format(fname, e) if warnmsg: warnmsg = 'WARNING: unable to read\n' + warnmsg print warnmsg