uproot5 icon indicating copy to clipboard operation
uproot5 copied to clipboard

Exception handling in uproot/source/coalesce.py

Open zlmarshall opened this issue 6 months ago • 1 comments

Hello,

In uproot/source/coalesce.py , when there is a bad response from an upstream server, this happens:

~/.local/lib/python3.11/site-packages/uproot/source/coalesce.py in result(self, timeout)
     37             # Pyodide futures don't support timeout
     38             return self._parent.result()[self._s]
---> 39         return self._parent.result(timeout=timeout)[self._s]
     40 
     41 

TypeError: 'ClientResponseError' object is not subscriptable

This looks like it just needs a bit nicer error handling to pass on the error appropriately. Of course, it's an error in any case, so it's just a matter of making sure that the "correct" error is shown rather than something with a stack from uproot.

(Of course, this is a pretty tricky one to give a reproducer for right now — our server has some instability that's generating the error, but it doesn't happen every time...)

Thanks, Zach

zlmarshall avatar Jun 16 '25 10:06 zlmarshall

Hi @zlmarshall . Thanks for reporting it! Indeed, the error message is not very helpful. I've added a cleanup label to indicate that it something that should be handled better. Thanks!

ianna avatar Jun 19 '25 11:06 ianna