From c305d2e9e3b80c00bbb71aa6f39420bdc01afaa2 Mon Sep 17 00:00:00 2001 From: amrita Date: Thu, 15 Jun 2023 09:36:07 +0545 Subject: [PATCH] Throw proper ocis-wrapper connection error message --- tests/TestHelpers/OcisConfigHelper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/TestHelpers/OcisConfigHelper.php b/tests/TestHelpers/OcisConfigHelper.php index 245934f5820..c1ba42ad0a4 100644 --- a/tests/TestHelpers/OcisConfigHelper.php +++ b/tests/TestHelpers/OcisConfigHelper.php @@ -22,6 +22,7 @@ namespace TestHelpers; +use GuzzleHttp\Exception\ConnectException; use TestHelpers\HttpRequestHelper; use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Psr7\Request; @@ -51,7 +52,12 @@ private static function sendRequest( [], $body ); - return $client->send($request); + + try { + return $client->send($request); + } catch (ConnectException $e) { + throw new Error("Cannot connect to the ociswrapper at the moment, make sure that ociswrapper is running before proceeding with the test run.\n" . $e->getMessage()); + } } /**