Revert "Revert "Added throw/catch for exceptions""

This reverts commit 85fe26ce49ae48b55a18c10e5ab9a4f6efa4c94a.