Skip to content

Commit

Permalink
Throw proper ocis-wrapper connection error message (#6532)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha authored and fschade committed Jul 10, 2023
1 parent 5910ca0 commit 8c669d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/TestHelpers/OcisConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

namespace TestHelpers;

use GuzzleHttp\Exception\ConnectException;
use TestHelpers\HttpRequestHelper;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
Expand Down Expand Up @@ -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());
}
}

/**
Expand Down

0 comments on commit 8c669d9

Please sign in to comment.