Complete the code to return a JSON error response with status code 404.
return jsonify({"error": "Resource not found"}), [1]
The HTTP status code 404 means the requested resource was not found.
Complete the code to include an error code in the JSON response for a bad request.
return jsonify({"error": "Bad request", "code": [1]), 400
The error code "BAD_REQUEST" clearly describes the error type in a machine-readable way.
Fix the error in the JSON error response to include a machine-readable error code and message.
response = {"message": "Unauthorized access", "error_code": [1]
return jsonify(response), 401The error code should be a string like "UNAUTHORIZED" for machine consumption, not a number or variable.
Fill both blanks to create a JSON error response with a code and a human message.
return jsonify({"error": [1], "message": [2]), 403
The error code "FORBIDDEN" and message "Access denied" clearly communicate the error.
Fill all three blanks to return a JSON error with code, message, and a numeric HTTP status.
error_response = {"code": [1], "message": [2], "status": [3]
return jsonify(error_response), [3]The error code is "INVALID_INPUT", message is descriptive, and status is the numeric HTTP code 422.