From b4c6a6c468026edcb8f32e4bd86ded440b3871ca Mon Sep 17 00:00:00 2001
From: Jaime Perez Crespo <jaime.perez@uninett.no>
Date: Wed, 13 Apr 2016 13:06:05 +0200
Subject: [PATCH] Simplify NotFound exceptions by removing the backtrace. It
 doesn't really help much.

---
 lib/SimpleSAML/Error/NotFound.php | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/SimpleSAML/Error/NotFound.php b/lib/SimpleSAML/Error/NotFound.php
index 90142901b..bdd7c56f9 100644
--- a/lib/SimpleSAML/Error/NotFound.php
+++ b/lib/SimpleSAML/Error/NotFound.php
@@ -51,4 +51,18 @@ class SimpleSAML_Error_NotFound extends SimpleSAML_Error_Error {
 		return $this->reason;
 	}
 
+
+	/**
+	 * NotFound exceptions don't need to display a backtrace, as they are very simple and the trace is usually trivial,
+	 * so just log the message without any backtrace at all.
+	 *
+	 * @param bool $anonymize Whether to anonymize the trace or not.
+	 *
+	 * @return array
+	 */
+	public function format($anonymize = false) {
+		return array(
+			$this->getClass().': '.$this->getMessage(),
+		);
+	}
 }
-- 
GitLab