From e968169e65a517ba658c100fd056d4aab765caaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no>
Date: Mon, 16 Sep 2019 15:24:31 +0200
Subject: [PATCH] Make it explicit that fetching or creating a session handler
 could throw an exception

This could happen when the handler is depending on a PHP extension, or connection to a database fails, or any other circumstance that may trigger an exception in the constructor of the session handler itself. We should be aware of this when using the session handler, therefore we update the phpdoc here to reflect that.
---
 lib/SimpleSAML/SessionHandler.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/SimpleSAML/SessionHandler.php b/lib/SimpleSAML/SessionHandler.php
index 1b679ce60..90cc55369 100644
--- a/lib/SimpleSAML/SessionHandler.php
+++ b/lib/SimpleSAML/SessionHandler.php
@@ -32,6 +32,8 @@ abstract class SessionHandler
      * to this function.
      *
      * @return \SimpleSAML\SessionHandler The current session handler.
+     *
+     * @throws \Exception If we cannot instantiate the session handler.
      */
     public static function getSessionHandler()
     {
@@ -126,6 +128,8 @@ abstract class SessionHandler
      * PHP session handler.
      *
      * @return void
+     *
+     * @throws \Exception If we cannot instantiate the session handler.
      */
     private static function createSessionHandler()
     {
-- 
GitLab