What is the bug?
Amazon OpenSearch has many security controls, including network security configuration such as only permitting access from a VPC. In my case, an active VPN connection is required for developers to access it.
Opensearch-cli returns a 0 exit code when it fails to make the request due to lack of network access to the endpoint. It should return a non-zero exit code instead, since the execution unambiguously failed. In cases where the request was completed but a non-2xx status code was returned, it might be less clear, but a non-zero code is probably still warranted.
In this case, I wanted to detect failure to show a helpful message suggesting the developer connect to VPN if they haven't already.
What is the bug?
Amazon OpenSearch has many security controls, including network security configuration such as only permitting access from a VPC. In my case, an active VPN connection is required for developers to access it.
Opensearch-cli returns a 0 exit code when it fails to make the request due to lack of network access to the endpoint. It should return a non-zero exit code instead, since the execution unambiguously failed. In cases where the request was completed but a non-2xx status code was returned, it might be less clear, but a non-zero code is probably still warranted.
In this case, I wanted to detect failure to show a helpful message suggesting the developer connect to VPN if they haven't already.