Avoid use of `catch` to fix compilation on old GHC