Refactored error handling in crypto tester