Handlers are now wrapped in a try-catch

Handler calls are now wrapped in a try-catch to ensure that all handlers receive their callback in the case of an error.