| Conditions | 5 | 
| Paths | 12 | 
| Total Lines | 20 | 
| Code Lines | 12 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 23 | public function __construct(string $message, int $code = 500, \Exception $exception = null) | ||
| 24 |     { | ||
| 25 | parent::__construct($message, $code); | ||
| 26 | |||
| 27 |         if ($exception === null) { | ||
| 28 | $exception = $this; | ||
| 29 | } | ||
| 30 | |||
| 31 |         if (!empty($message)) { | ||
| 32 | $message .= " "; | ||
| 33 | } | ||
| 34 | |||
| 35 |         $this->errorMessage = get_class($exception) . " is thrown: " . $message . $exception->getFile() . "(" . $exception->getLine() . ")"; | ||
| 36 |         $stacktraceList = explode("#", $exception->getTraceAsString()); | ||
| 37 |         foreach ($stacktraceList as $stacktraceLine) { | ||
| 38 |             if ($stacktraceLine === "") { | ||
| 39 | continue; | ||
| 40 | } | ||
| 41 | $this->errorMessage .= PHP_EOL; | ||
| 42 | $this->errorMessage .= "\t#" . trim($stacktraceLine); | ||
| 43 | } | ||
| 55 |