public function onException(FailCallEvent $event)
    {
        $exception = $event->getException();
        $logLevel = $this->getLogLevel($exception);

        if ($exception instanceof NetworkException) {
            $this->logger->log($logLevel, 'Call {method} completed with network error: {error}', [
                'method' => $event->getMethodRef(),
                'login' => $event->getUser()->getLogin(),
                'request_id' => $event->getRequestId(),
                'error' => $exception->getMessage(),
            ]);
        } else {
            $message = sprintf(
                'Call {method} completed with exception %s: %s',
                get_class($exception),
                $exception->getMessage()
            );
            $this->logger->log($logLevel, $message, [
                'method' => $event->getMethodRef(),
                'request_id' => $event->getRequestId(),
                'login' => $event->getUser()->getLogin(),
                'code' => $exception->getCode(),
                'exception' => $exception,
            ]);
        }
    }
public function onException(FailCallEvent $event)
    {
        $exception = $event->getException();
        $logLevel = $this->getLogLevel($exception);

        if ($exception instanceof NetworkException) {
            $this->logger->log($logLevel, 'Call {method} completed with network error: {error}', [
                'method' => $event->getMethodRef(),
                'login' => $event->getUser()->getLogin(),
                'request_id' => $event->getRequestId(),
                'error' => $exception->getMessage(),
            ]);
        } else {
            $message = sprintf(
                'Call {method} completed with exception %s: %s',
                get_class($exception),
                $exception->getMessage()
            );
            $this->logger->log($logLevel, $message, [
                'method' => $event->getMethodRef(),
                'request_id' => $event->getRequestId(),
                'login' => $event->getUser()->getLogin(),
                'code' => $exception->getCode(),
                'exception' => $exception,
            ]);
        }
    }
public function onException ( FailCallEvent $ event ) { $ exception = $ event -> getException ( ) ; $ logLevel = $ this -> getLogLevel ( $ exception ) ; if ( $ exception instanceof NetworkException ) { $ this -> logger -> log ( $ logLevel , 'Call {method} completed with network error: {error}' , [ 'method' => $ event -> getMethodRef ( ) , 'login' => $ event -> getUser ( ) -> getLogin ( ) , 'request_id' => $ event -> getRequestId ( ) , 'error' => $ exception -> getMessage ( ) , ] ) ; } else { $ message = sprintf ( 'Call {method} completed with exception %s: %s' , get_class ( $ exception ) , $ exception -> getMessage ( ) ) ; $ this -> logger -> log ( $ logLevel , $ message , [ 'method' => $ event -> getMethodRef ( ) , 'request_id' => $ event -> getRequestId ( ) , 'login' => $ event -> getUser ( ) -> getLogin ( ) , 'code' => $ exception -> getCode ( ) , 'exception' => $ exception , ] ) ; } }
Logs the thrown exception.

@param FailCallEvent $event
Logs the thrown exception .