mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge branch '3.2.x'
This commit is contained in:
commit
7a54b0631d
2 changed files with 2 additions and 12 deletions
|
@ -3,7 +3,6 @@ services:
|
||||||
class: phpbb\console\exception_subscriber
|
class: phpbb\console\exception_subscriber
|
||||||
arguments:
|
arguments:
|
||||||
- '@language'
|
- '@language'
|
||||||
- '%debug.exceptions%'
|
|
||||||
tags:
|
tags:
|
||||||
- { name: kernel.event_subscriber }
|
- { name: kernel.event_subscriber }
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,10 @@ class exception_subscriber implements EventSubscriberInterface
|
||||||
* Construct method
|
* Construct method
|
||||||
*
|
*
|
||||||
* @param \phpbb\language\language $language Language object
|
* @param \phpbb\language\language $language Language object
|
||||||
* @param bool $debug Debug mode
|
|
||||||
*/
|
*/
|
||||||
public function __construct(\phpbb\language\language $language, $debug = false)
|
public function __construct(\phpbb\language\language $language)
|
||||||
{
|
{
|
||||||
$this->language = $language;
|
$this->language = $language;
|
||||||
$this->debug = $debug;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,14 +50,7 @@ class exception_subscriber implements EventSubscriberInterface
|
||||||
$parameters = array_merge(array($original_exception->getMessage()), $original_exception->get_parameters());
|
$parameters = array_merge(array($original_exception->getMessage()), $original_exception->get_parameters());
|
||||||
$message = call_user_func_array(array($this->language, 'lang'), $parameters);
|
$message = call_user_func_array(array($this->language, 'lang'), $parameters);
|
||||||
|
|
||||||
if ($this->debug)
|
$exception = new \RuntimeException($message , $original_exception->getCode(), $original_exception);
|
||||||
{
|
|
||||||
$exception = new \RuntimeException($message , $original_exception->getCode(), $original_exception);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$exception = new \RuntimeException($message , $original_exception->getCode());
|
|
||||||
}
|
|
||||||
|
|
||||||
$event->setException($exception);
|
$event->setException($exception);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue