mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-20 00:21:42 +02:00
Merge pull request #4950 from Nicofuma/ticket/15357-3.2.x
[ticket/15298] Never suppress exception trace when using CLI
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user