Skip to content
Snippets Groups Projects
Commit 36d83058 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fixes for lib/SimpleSAML/Error

parent ab7303e0
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ class Assertion extends Exception
*
* This function will register this assertion handler. If will not enable assertions if they are
* disabled.
* @return void
*/
public static function installHandler()
{
......@@ -71,6 +72,7 @@ class Assertion extends Exception
* @param string $file The file assert was called from.
* @param int $line The line assert was called from.
* @param mixed $message The expression which was passed to the assert-function.
* @return void
*/
public static function onAssertion($file, $line, $message)
{
......
......@@ -12,13 +12,15 @@ namespace SimpleSAML\Error;
class AuthSource extends Error
{
/**
* Authsource module name.
* Authsource module name
* @var string
*/
private $authsource;
/**
* Reason why this request was invalid.
* @var string
*/
private $reason;
......@@ -28,6 +30,7 @@ class AuthSource extends Error
*
* @param string $authsource Authsource module name from where this error was thrown.
* @param string $reason Description of the error.
* @param Exception|null $cause
*/
public function __construct($authsource, $reason, $cause = null)
{
......
......@@ -16,6 +16,7 @@ class BadRequest extends Error
{
/**
* Reason why this request was invalid.
* @var string
*/
private $reason;
......
......@@ -60,7 +60,7 @@ class CriticalConfigurationError extends ConfigurationError
/**
* @param ConfigurationError $exception
* @param \Exception $exception
*
* @return CriticalConfigurationError
*/
......
......@@ -155,6 +155,7 @@ class Error extends Exception
* Set the HTTP return code for this error.
*
* This should be overridden by subclasses who want a different return code than 500 Internal Server Error.
* @return void
*/
protected function setHTTPCode()
{
......@@ -208,6 +209,7 @@ class Error extends Exception
* Display this error.
*
* This method displays a standard SimpleSAMLphp error page and exits.
* @return void
*/
public function show()
{
......
......@@ -21,15 +21,15 @@ class Exception extends \Exception
*
* @var array
*/
private $backtrace;
private $backtrace = [];
/**
* The cause of this exception.
*
* @var Exception
* @var Exception|null
*/
private $cause;
private $cause = null;
/**
......@@ -77,6 +77,7 @@ class Exception extends \Exception
* Load the backtrace from the given exception.
*
* @param \Exception $exception The exception we should fetch the backtrace from.
* @return void
*/
protected function initBacktrace(\Exception $exception)
{
......@@ -193,6 +194,8 @@ class Exception extends \Exception
/**
* Print the backtrace to the log if the 'debug' option is enabled in the configuration.
* @param int $level
* @return void
*/
protected function logBacktrace($level = \SimpleSAML\Logger::DEBUG)
{
......@@ -231,6 +234,7 @@ class Exception extends \Exception
* Override to allow errors extending this class to specify the log level themselves.
*
* @param int $default_level The log level to use if this method was not overridden.
* @return void
*/
public function log($default_level)
{
......@@ -248,6 +252,7 @@ class Exception extends \Exception
* Print the exception to the log with log level error.
*
* This function will write this exception to the log, including a full backtrace.
* @return void
*/
public function logError()
{
......@@ -260,6 +265,7 @@ class Exception extends \Exception
* Print the exception to the log with log level warning.
*
* This function will write this exception to the log, including a full backtrace.
* @return void
*/
public function logWarning()
{
......@@ -272,6 +278,7 @@ class Exception extends \Exception
* Print the exception to the log with log level info.
*
* This function will write this exception to the log, including a full backtrace.
* @return void
*/
public function logInfo()
{
......@@ -284,6 +291,7 @@ class Exception extends \Exception
* Print the exception to the log with log level debug.
*
* This function will write this exception to the log, including a full backtrace.
* @return void
*/
public function logDebug()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment