Error handling now works as expected.