Revert "Removed try-catch for performance reasons"

This reverts commit 57bbfcbd0392d0943b5f5699872096810407d4ba.