Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
16 | public function getExceptionMessage(Throwable $e): string |
||
17 | { |
||
18 | $text = ''; |
||
19 | |||
20 | if (!empty(config('app.name'))) { |
||
21 | $text .= 'Project URL: ' . '[' . url('/') . '](' . url('/') . ')' . PHP_EOL; |
||
22 | } |
||
23 | |||
24 | $text .= 'Env: ' . config('app.env') . PHP_EOL; |
||
25 | $text .= 'Exception: ' . get_class($e) . PHP_EOL; |
||
26 | $text .= '```Error: ' . $e->getMessage() . '```' . PHP_EOL; |
||
27 | $text .= '```Trace: ' . $e->getTraceAsString() . '```' . PHP_EOL; |
||
28 | |||
29 | if (mb_strlen($text) > self::MESSAGE_LENGTH) { |
||
30 | $text = mb_substr($text, 0, self::MESSAGE_LENGTH); |
||
31 | $text = rtrim($text) . '...```'; |
||
32 | } |
||
33 | |||
34 | return $text; |
||
35 | } |
||
37 |