From c0c9a44d82c366611b41f9bf6b2f008ec2373fa1 Mon Sep 17 00:00:00 2001 From: Mika Vaara Date: Wed, 19 Jan 2022 17:49:33 +0200 Subject: [PATCH] Outlining the design patterns for self-made exception and error messages --- controller/SkosmosExceptions.php | 14 ++++++++++++++ rest.php | 12 +++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 controller/SkosmosExceptions.php diff --git a/controller/SkosmosExceptions.php b/controller/SkosmosExceptions.php new file mode 100644 index 000000000..142ce46c4 --- /dev/null +++ b/controller/SkosmosExceptions.php @@ -0,0 +1,14 @@ +getMessage()); +//} +}catch(Exception $e) { header("HTTP/1.0 500 Internal Server Error"); - echo('ERROR: ' . $e->getMessage()); + echo(TimeoutException::throwExceptionMessage()); }