parent
07fb82357b
commit
2c8235d486
|
@ -4,6 +4,7 @@
|
||||||
namespace Icinga\Exception;
|
namespace Icinga\Exception;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use ReflectionClass;
|
||||||
|
|
||||||
class IcingaException extends Exception
|
class IcingaException extends Exception
|
||||||
{
|
{
|
||||||
|
@ -25,4 +26,17 @@ class IcingaException extends Exception
|
||||||
}
|
}
|
||||||
parent::__construct(vsprintf($message, $args), 0, $exc);
|
parent::__construct(vsprintf($message, $args), 0, $exc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the exception from an array of arguments
|
||||||
|
*
|
||||||
|
* @param array $args
|
||||||
|
*
|
||||||
|
* @return static
|
||||||
|
*/
|
||||||
|
public static function create(array $args)
|
||||||
|
{
|
||||||
|
$e = new ReflectionClass(get_called_class());
|
||||||
|
return $e->newInstanceArgs($args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue