From 0c06849c67200d9900ba0a9b01f061cd4edbcc14 Mon Sep 17 00:00:00 2001 From: "olivier.p" Date: Mon, 16 Oct 2023 16:53:27 +0200 Subject: [PATCH] feat: handle errors while sending informations to universign --- Requester/XmlRpcRequester.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Requester/XmlRpcRequester.php b/Requester/XmlRpcRequester.php index 86fb97e..7cde5fb 100644 --- a/Requester/XmlRpcRequester.php +++ b/Requester/XmlRpcRequester.php @@ -80,6 +80,10 @@ protected function send(string $method, $params): mixed { $response = $this->xmlRpcClient->send($this::buildRequest($method, $this->flatten($params))); + if (!empty($response->faultString())) { + throw new \UnexpectedValueException('Error while sending informations to universign : ' . $response->faultString()); + } + return $response->value(); }