Format try catch

Simplify error handling logic from #56