-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
ApiGatewayManagementApiException does not parse actual AWS error code from response #2285
Comments
@georgeboot Thanks for bringing this to our attention! I was able to reproduce this, and it looks like they don't send back the service doesn't send back a mandatory header which causes our parsing to fail. I will open a ticket with the team and discuss with them to see how fast they can add this header |
@georgeboot Looked into it a bit further, and needed a bit more info: is your API that you're using to test a WebSocket API (as opposed to REST or HTTP)? |
Yes indeed, a websocket api. I'm sending messages to a websocket but need to handle the connection being gone (and the disconnect event not being executed yet). I am currently unable to catch the gone exception as demonstrated above. I've replicated the above scenario on a real websocket APi as I was unable to mock the error in the SDK. When appending to a |
@georgeboot Thanks for responding so quickly! Do you mind setting
|
Hi @georgeboot, Closing this for staleness, but let us know if you're still having issues! |
|
Workaround: <?php
use Aws\ApiGatewayManagementApi\Exception\ApiGatewayManagementApiException;
assert($exception instanceof ApiGatewayManagementApiException);
assert($exception->getResponse()->getStatusCode() === 410); |
Describe the bug
When a cal to the ApiGatewayManagementApi results in an error, the corresponding exception is not properly set-up.
Version of AWS SDK for PHP?
3.186.1
Version of PHP (
php -v
)?8.0
To Reproduce (observed behavior)
Will output the following exception:
Expected behavior
The text was updated successfully, but these errors were encountered: