From 1cacbfd45902608536965827a676c7019fad37f1 Mon Sep 17 00:00:00 2001 From: Mikhail Yarmaliuk Date: Fri, 22 May 2020 17:29:50 +0300 Subject: [PATCH] fix exception message --- composer.json | 2 +- src/Microservice.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7533b00..c4f6bdd 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "kakadu-dev/php-ijson-microservices", - "version": "1.1.0", + "version": "1.1.1", "description": "Package for create microservice architecture based on PHP.", "homepage": "https://github.com/kakadu-dev/php-ijson-microservices", "type": "library", diff --git a/src/Microservice.php b/src/Microservice.php index 15901ca..4b76e6b 100644 --- a/src/Microservice.php +++ b/src/Microservice.php @@ -154,7 +154,7 @@ public function sendServiceRequest(string $service, string $method, $data, bool $response = json_decode($rawResponse->getContents(), true); if (!empty($response['error'])) { - throw new MicroserviceException($response['error']); + throw new MicroserviceException($response['error']['message'] ?? 'Unknown error.'); } return new MjResponse($response);