Catch exceptions from crypto methods