Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / vendor / psy / psysh / src / Psy / Exception / ThrowUpException.php
1 <?php
2
3 /*
4  * This file is part of Psy Shell.
5  *
6  * (c) 2012-2017 Justin Hileman
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Psy\Exception;
13
14 /**
15  * A throw-up exception, used for throwing an exception out of the Psy Shell.
16  */
17 class ThrowUpException extends \Exception implements Exception
18 {
19     /**
20      * {@inheritdoc}
21      */
22     public function __construct(\Exception $exception)
23     {
24         $message = sprintf("Throwing %s with message '%s'", get_class($exception), $exception->getMessage());
25         parent::__construct($message, $exception->getCode(), $exception);
26     }
27
28     /**
29      * Return a raw (unformatted) version of the error message.
30      *
31      * @return string
32      */
33     public function getRawMessage()
34     {
35         return $this->getPrevious()->getMessage();
36     }
37 }