diff options
author | Florian Dold <dold@inria.fr> | 2015-12-20 01:24:54 +0100 |
---|---|---|
committer | Florian Dold <dold@inria.fr> | 2015-12-20 01:24:54 +0100 |
commit | f8240b386da14cd28318a28be96436fd9a3b7827 (patch) | |
tree | eca12a5407b73eed4945d1b891ad23af86be6396 | |
parent | d956c39945c280d75407429158e088cc6b050f5b (diff) | |
download | merchant-f8240b386da14cd28318a28be96436fd9a3b7827.tar.gz merchant-f8240b386da14cd28318a28be96436fd9a3b7827.tar.bz2 merchant-f8240b386da14cd28318a28be96436fd9a3b7827.zip |
Add error handler.
Otherwise, the javascript thinks that the PHP error
is the contract.
-rw-r--r-- | src/frontend/generate_taler_contract.php | 13 |
1 files changed, 12 insertions, 1 deletions
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; |