From 8fc2f7f6146eb532f1bedd8aa9cdd9fbdf5e1b52 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 10 Dec 2017 20:52:23 +0100 Subject: [PATCH] Added 'InvalidURI' error + made it possible for 'ModuleError' to have an argument description --- build/error/core/Err.php | 28 +++++++++++++++------------- build/error/core/Error.php | 8 +++++++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/build/error/core/Err.php b/build/error/core/Err.php index d029f9f..720190b 100755 --- a/build/error/core/Err.php +++ b/build/error/core/Err.php @@ -63,6 +63,8 @@ const WrongParam = 17; /* (12) Erreur dans le traitement */ const ModuleError = 18; + /* (13) URI Invalide */ + const InvalidURI = 19; /* [5] Database @@ -70,50 +72,50 @@ /* (1) Base de données ---------------------------------------------------------*/ /* (1) Erreur lors de la creation d'un objet PDO (connection) */ - const PDOConnection = 19; + const PDOConnection = 20; /* (2) Repositories ---------------------------------------------------------*/ /* (1) Verification de la coherence du chemin (existe dans la conf) */ - const WrongPathRepo = 20; + const WrongPathRepo = 21; /* (2) Module non specifie dans la conf */ - const UnknownRepo = 21; + const UnknownRepo = 22; /* (3) Erreur dans le traitement */ - const RepoError = 22; + const RepoError = 23; /* (3) ORM ---------------------------------------------------------*/ /* (1) Table n'existe pas */ - const UnknownTable = 23; + const UnknownTable = 24; /* (2) Pas permissions de lire le schéma */ - const NotAllowedSchema = 24; + const NotAllowedSchema = 25; /* [6] Erreurs diverses =========================================================*/ /* (1) Aucune donnée trouvée */ - const NoMatchFound = 25; + const NoMatchFound = 26; /* (2) Mauvais chemin de template */ - const UnknownTemplate = 26; + const UnknownTemplate = 27; /* (3) géolocalisation échouée */ - const UnknownAddress = 27; + const UnknownAddress = 28; /* (4) Erreur inconnue */ - const UnknownError = 28; + const UnknownError = 29; /* (5) Entrée existante */ - const AlreadyExists = 29; + const AlreadyExists = 30; /* (6) Corps manquant */ - const MissingBody = 30; + const MissingBody = 31; /* (7) Header manquant */ - const MissingHeaders = 31; + const MissingHeaders = 32; } ?> diff --git a/build/error/core/Error.php b/build/error/core/Error.php index 31d0a2f..8f597ff 100755 --- a/build/error/core/Error.php +++ b/build/error/core/Error.php @@ -78,6 +78,7 @@ case Err::MissingParam: return $this->MissingParam(); break; case Err::WrongParam: return $this->WrongParam(); break; case Err::ModuleError: return $this->ModuleError(); break; + case Err::InvalidURI: return $this->InvalidURI(); break; case Err::PDOConnection: return $this->PDOConnection(); break; case Err::WrongPathRepo: return $this->WrongPathRepo(); break; case Err::UnknownRepo: return $this->UnknownRepo(); break; @@ -161,7 +162,12 @@ else return 'wrong param'; }private function ModuleError(){ - return 'module error'; + if( count($this->arguments) > 0 ) + return 'module error: \''.$this->arguments[0].'\''; + else + return 'module error'; + }private function InvalidURI(){ + return 'invalid URI'; }private function PDOConnection(){ return 'database error'; }private function WrongPathRepo(){