Ravi Sir's Cards › AWS
Catch by error code
This revision card explains Catch by error code. It starts from the need that python — ClientError. It describes PHP — AwsException. The how-to section notes node — err.name. An example on the card is retry throttles and 5xx, fix 4xx.
Read card text
What this card says
Why do we need it?
Python: ClientError.
e.response["Error"]["Code"]
What is it?
PHP: AwsException.
$e->getAwsErrorCode()
How to do it
Node: err.name.
err.$metadata.httpStatusCode
Example
Retry throttles and 5xx, fix 4xx.