| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class JavaProxiedException extends RuntimeException implements JavaProxiedExceptionInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var JavaException |
||
| 22 | */ |
||
| 23 | private $javaException; |
||
| 24 | |||
| 25 | 10 | public function __construct(JavaException $javaException, ?string $msg = null, ?int $code = null) |
|
| 26 | { |
||
| 27 | 10 | $this->javaException = $javaException; |
|
| 28 | 10 | $message = sprintf( |
|
| 29 | 10 | '%s[%s]: %s (%s)', |
|
| 30 | 10 | $msg !== null ? "$msg. " : '', |
|
| 31 | 10 | $javaException->getJavaClassName(), |
|
| 32 | 10 | $javaException->getMessage(), |
|
| 33 | 10 | $javaException->getCause() |
|
| 34 | ); |
||
| 35 | 10 | parent::__construct($message, $code ?? $javaException->getCode()); |
|
| 36 | 10 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Return java exception as return by the bridge server. |
||
| 40 | */ |
||
| 41 | 1 | public function getJavaException(): JavaException |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Return the JVM exception backtrace. |
||
| 48 | */ |
||
| 49 | 1 | public function getJvmStackTrace(): string |
|
| 52 | } |
||
| 53 | } |
||
| 54 |