Expanded error handling example.