Closed taldcroft closed 3 years ago
I side note on this:
I always find confusing when I see these exception chains, although this case is simple because the first exception seems to be short. The first exception does not add any information, so I would write it like:
try:
val = object.__getattribute__(self, '_val')
except AttributeError:
try:
val = object.__getattribute__(self, '_load_func')()
self._val = val
except Exception as e:
raise e from None
That clears the first exception and only shows the second.
but I guess it's a matter of taste
@javierggt - your comment is fair enough but OBE since I moved to using a new module in ska_helpers for retrying. I'll admit that the stack trace is probably even more confusing now since there is also a decorator in the mix, but I've already spent too much time on this and it does seem to work. I'm going to do the same retry for the update code (in a separate PR).
Description
Fix the problem seen in shiny testing from Replan Central by trying up to 3 times to read the
cmds.h5
file.@jeanconn also remembered a plan B of copying the
cmds.*
files to a temp dir for updating as done with events in #124.Testing
Functional testing
I updated the code to force a bad filename since I don't know how to reproducibly generate the
resource unavailable
error.