Introducing a specific function for generating a server error (500) response.