From f8240b386da14cd28318a28be96436fd9a3b7827 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 20 Dec 2015 01:24:54 +0100 Subject: Add error handler. Otherwise, the javascript thinks that the PHP error is the contract. --- src/frontend/generate_taler_contract.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/frontend/generate_taler_contract.php b/src/frontend/generate_taler_contract.php index c71542c8..4fedd9cb 100644 --- a/src/frontend/generate_taler_contract.php +++ b/src/frontend/generate_taler_contract.php @@ -30,7 +30,18 @@ if the whole "journey" to the backend is begin tested - $ curl http://merchant_url/generate_taler_contract.php?backend_test=no if just the frontend job is being tested -*/ + */ + + +register_shutdown_function(function() { + $lastError = error_get_last(); + + if (!empty($lastError) && $lastError['type'] == E_ERROR) { + header('Status: 500 Internal Server Error'); + header('HTTP/1.0 500 Internal Server Error'); + } +}); + $cli_debug = false; $backend_test = true; -- cgit v1.2.3