Generic try catch