spacetelescope / pandokia

Regression tests framework.
Other
2 stars 4 forks source link

Raise the actual error that was most recently being handled #69

Closed ariedel closed 4 years ago

ariedel commented 4 years ago

Steuermann interprets not yet filed (None) as "" and then passes them to pandokia to parse. Because these are not valid dates of any kind, they fail down to the bottom of the function, where a bare 'raise' was put. This is now causing errors in the HST ETC:

RuntimeError: No active exception to reraise
      args = ('No active exception to reraise',)
      with_traceback = <built-in method with_traceback of RuntimeError object> 

I think something recently changed with the scope of exception handling in Python, such that "previously in the function" no longer counts as actively being handled. (https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement)

I'm storing the exceptions to explicitly re-raise. In theory, saving only the last one should be sufficient, but I think it's tidier to save each of them.