> This feels like a lot of redundant code with a try-catch in every throwable
> method. Have you considered making a class or helper function that takes in
> and calls a lambda wrapped in the try-catch? Something like:
>
> def try_container_action(self, func):
> try:
> with ContainerRunning(self.container):
> func()
> except RuntimeError as e:
> return handle_runtime_error(e)
>
> Where "func" is a lambda for the one-liner in each method. You could also pull
> the contents of handle_runtime_error(e) into that method. Your thoughts?
We talked about this and decided to move on with our lives.
> This feels like a lot of redundant code with a try-catch in every throwable action( self, func): g(self. container) : runtime_ error(e) runtime_ error(e) into that method. Your thoughts?
> method. Have you considered making a class or helper function that takes in
> and calls a lambda wrapped in the try-catch? Something like:
>
> def try_container_
> try:
> with ContainerRunnin
> func()
> except RuntimeError as e:
> return handle_
>
> Where "func" is a lambda for the one-liner in each method. You could also pull
> the contents of handle_
We talked about this and decided to move on with our lives.