| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function onRpcException(GetExceptionResponseEvent $event) |
||
| 14 | { |
||
| 15 | $request = $event->getRequest(); |
||
| 16 | if (!$request instanceof JsonRpcRequestInterface) { |
||
| 17 | return; |
||
| 18 | } |
||
| 19 | |||
| 20 | $exception = $event->getException(); |
||
| 21 | |||
| 22 | if (!$exception instanceof AccessDeniedException) { |
||
| 23 | return; |
||
| 24 | } |
||
| 25 | |||
| 26 | $event->setException( |
||
| 27 | JsonRpcException::create( |
||
| 28 | JsonRpcError::METHOD_NOT_FOUND, |
||
| 29 | $exception->getMessage(), |
||
| 30 | $exception->getTrace() |
||
| 31 | ) |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |