Add test case for error 500 handling.