From 1634a1b50636cdc80fa91bf62fae170779c2ff27 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Wed, 9 Feb 2011 12:42:24 +0000 Subject: [PATCH] Error_MetadataNotFound: Pass proper error code to constructor. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2740 44740490-163a-0410-bde0-09ae8108e29a --- dictionaries/errors.definition.json | 6 ++++++ lib/SimpleSAML/Error/MetadataNotFound.php | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dictionaries/errors.definition.json b/dictionaries/errors.definition.json index f2b9261f1..b2d6cfb4b 100644 --- a/dictionaries/errors.definition.json +++ b/dictionaries/errors.definition.json @@ -205,5 +205,11 @@ }, "descr_NOSTATE": { "en": "State information lost, and no way to restart the request" + }, + "title_METADATANOTFOUND": { + "en": "Metadata not found" + }, + "descr_METADATANOTFOUND": { + "en": "Unable to locate metadata for %ENTITYID%" } } diff --git a/lib/SimpleSAML/Error/MetadataNotFound.php b/lib/SimpleSAML/Error/MetadataNotFound.php index d079331fb..fb2d48323 100644 --- a/lib/SimpleSAML/Error/MetadataNotFound.php +++ b/lib/SimpleSAML/Error/MetadataNotFound.php @@ -24,7 +24,11 @@ class SimpleSAML_Error_MetadataNotFound extends SimpleSAML_Error_Error { public function __construct($entityId) { assert('is_string($entityId)'); - parent::__construct('Unable to locate metadata for ' . var_export($entityId, TRUE) . '.'); + parent::__construct(array( + 'METADATANOTFOUND', + 'ENTITYID' => htmlspecialchars(var_export($entityId, TRUE)) + )); + $this->entityId = $entityId; } -- GitLab