Description
Sending a division request with b: 0 causes an unhandled ZeroDivisionError that returns a raw 500 Internal Server Error to the client.
Steps to reproduce
curl -X POST http://localhost:5000/divide -H "Content-Type: application/json" -d '{"a": 10, "b": 0}'
Expected behavior
Should return 400 Bad Request with a clear message: {"error": "division by zero is not allowed"}.
Actual behavior
Returns 500 Internal Server Error with a Python traceback (in debug mode) or an empty error page.
Description
Sending a division request with
b: 0causes an unhandled ZeroDivisionError that returns a raw 500 Internal Server Error to the client.Steps to reproduce
Expected behavior
Should return
400 Bad Requestwith a clear message:{"error": "division by zero is not allowed"}.Actual behavior
Returns
500 Internal Server Errorwith a Python traceback (in debug mode) or an empty error page.