From a2d3a146fa8d98dd0bad48389b447335d87738c1 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Tue, 28 Feb 2023 09:50:32 +0100 Subject: [PATCH] Add Error Catch --- Source/API/script/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/API/script/index.php b/Source/API/script/index.php index a038c8b..b59f9fc 100644 --- a/Source/API/script/index.php +++ b/Source/API/script/index.php @@ -45,7 +45,9 @@ try{ // Run app $app->run(); -}catch (HttpNotFoundException|Exception $e){ - echo "Error :".$e->getMessage(); +}catch (HttpNotFoundException $e){ + echo "Error, not Found : ".$e->getMessage(); +}catch (TypeError $t){ + echo "Error, wrong parameters key, or no parameters write : ".$t->getMessage(); }