Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(sdk): drop the silent-gateway limit from the PHP timeout notes
Yudhi Armyndharisd27317923a59
diff --git a/docs/18-sdk-design.md b/docs/18-sdk-design.mdindex 5396d8399..2532c46b1 100644--- a/docs/18-sdk-design.md+++ b/docs/18-sdk-design.md@@ -1090,7 +1090,7 @@ All payloads are associative arrays; all listed methods are synchronous and retu### Error Handling-All exceptions the SDK raises itself live in `OpenWA\Exceptions` and descend from `OpenWAException` (which extends PHP's `\Exception`). A transport failure that is not a timeout (a refused connection, a reset, a TLS verification failure) surfaces as one of Guzzle's own `GuzzleHttp\Exception\TransferException` subclasses and an invalid argument as `InvalidArgumentException`, so a catch-all names those as well. The subclass depends on the Guzzle major (a reset is a `RequestException` on Guzzle 7 and a `NetworkException`, which is not a `RequestException`, on Guzzle 8), so catch `TransferException` rather than a subclass. On Guzzle's stream handler (a host without `ext-curl`) a gateway that stays silent past the timeout is such a failure too, not an `OpenWATimeoutException` (see the [PHP README](../sdk/php/README.md)). Any non-2xx response is raised as an `OpenWAApiException`; the static `classify()` factory picks the most specific subclass by status code. An `OpenWAApiException` carries the HTTP status (`getStatus(): int`), the parsed error body (`getBody(): mixed`), and the NestJS `error` kind when present (`getErrorKind(): ?string`), plus the body's `code` (`getErrorCode(): ?string`), the retry delay in seconds from the body's `retryAfterSeconds` or the `Retry-After` header (`getRetryAfterSeconds(): ?int`) and the response headers (`getHeaders(): array`).+All exceptions the SDK raises itself live in `OpenWA\Exceptions` and descend from `OpenWAException` (which extends PHP's `\Exception`). A transport failure that is not a timeout (a refused connection, a reset, a TLS verification failure) surfaces as one of Guzzle's own `GuzzleHttp\Exception\TransferException` subclasses and an invalid argument as `InvalidArgumentException`, so a catch-all names those as well. The subclass depends on the Guzzle major (a reset is a `RequestException` on Guzzle 7 and a `NetworkException`, which is not a `RequestException`, on Guzzle 8), so catch `TransferException` rather than a subclass. On Guzzle 7's stream handler (a host without `ext-curl`) a `timeout` of `0` still leaves PHP's `default_socket_timeout` before the response headers, and that wait ends with such a failure too, not an `OpenWATimeoutException` (see the [PHP README](../sdk/php/README.md)). Any non-2xx response is raised as an `OpenWAApiException`; the static `classify()` factory picks the most specific subclass by status code. An `OpenWAApiException` carries the HTTP status (`getStatus(): int`), the parsed error body (`getBody(): mixed`), and the NestJS `error` kind when present (`getErrorKind(): ?string`), plus the body's `code` (`getErrorCode(): ?string`), the retry delay in seconds from the body's `retryAfterSeconds` or the `Retry-After` header (`getRetryAfterSeconds(): ?int`) and the response headers (`getHeaders(): array`).| Exception | Extends | Trigger || ----------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |diff --git a/sdk/README.md b/sdk/README.mdindex e150d33e0..9b4f54d41 100644--- a/sdk/README.md+++ b/sdk/README.md@@ -279,11 +279,10 @@ testing, retry, tracing, or metrics. See [`go/README.md`](go/README.md).builder refuses it. The JavaScript, PHP, Go and Java clients bound the whole call,response body included. The Python client's is per network operation(connect, read, write, pool), so a response that keeps trickling bytes is not- cut off. On PHP, Guzzle's stream handler (a host without `ext-curl`) differs: a- gateway that stays silent past the timeout surfaces as a Guzzle exception, not- `OpenWATimeoutException`, and on Guzzle 7 a `0` still leaves PHP's- `default_socket_timeout` (60s by default) before the response headers; see the- PHP README. Path segments (chat / message ids) are percent-encoded; a base-URL path+ cut off. On PHP, Guzzle 7's stream handler (a host without `ext-curl`) differs: a+ `0` still leaves PHP's `default_socket_timeout` (60s by default) before the+ response headers, and that wait ends with a Guzzle exception, not+ `OpenWATimeoutException`; see the PHP README. Path segments (chat / message ids) are percent-encoded; a base-URL pathprefix (e.g. behind a proxy at `/v1`) is preserved.## Development