We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello there,
is there a way to try/catch exceptions like "404 Not Found" when querying the API?
OpenStack\Common\Error\BadResponseError: HTTP Error ~~~~~~~~~~ The remote server returned a "404 Not Found" error for the following transaction: [...]
While instancing OpenStack object I have tried to pass argument:
'requestOptions' => [ 'http_errors' => false ],
but doesn't work. Either with a try/catch:
try { $server = $compute->getServer(['id' => $this->openstack_id ]); $server->retrieve(); } catch( ClientErrorResponseException $e ) { [...] }
Thank you!
The text was updated successfully, but these errors were encountered:
Resolved with this:
use GuzzleHttp\Exception\ClientErrorResponseException; ... try { $server = $api->createServer( $options ); ... } catch( \Exception $e ) { if( $e->getResponse()->getStatusCode() == 403 ) ... }
Sorry, something went wrong.
No branches or pull requests
Hello there,
is there a way to try/catch exceptions like "404 Not Found" when querying the API?
While instancing OpenStack object I have tried to pass argument:
'requestOptions' => [ 'http_errors' => false ],
but doesn't work. Either with a try/catch:
Thank you!
The text was updated successfully, but these errors were encountered: