Use try/catch instead of catch

Thanks Richard Carlsson for the remainder.