From ae8c4195b3284c73c3a9080b5e306733d2230b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no> Date: Sat, 2 Jul 2016 17:16:21 +0200 Subject: [PATCH] Make the SimpleSAML\Utils\HTTP::setCookie() method throw the new SimpleSAML\Error\CannotSetCookie exception. --- lib/SimpleSAML/Utils/HTTP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php index 035ce8ff5..c1121de5c 100644 --- a/lib/SimpleSAML/Utils/HTTP.php +++ b/lib/SimpleSAML/Utils/HTTP.php @@ -1008,7 +1008,7 @@ class HTTP * @param bool $throw Whether to throw exception if setcookie() fails. * * @throws \InvalidArgumentException If any parameter has an incorrect type. - * @throws \SimpleSAML_Error_Exception If the headers were already sent and the cookie cannot be set. + * @throws \SimpleSAML\Error\CannotSetCookie If the headers were already sent and the cookie cannot be set. * * @author Andjelko Horvat * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> @@ -1079,7 +1079,7 @@ class HTTP if (!$success) { if ($throw) { - throw new \SimpleSAML_Error_Exception('Error setting cookie: headers already sent.'); + throw new \SimpleSAML\Error\CannotSetCookie('Headers already sent.'); } else { Logger::warning('Error setting cookie: headers already sent.'); } -- GitLab