Skip to content

Latest commit

 

History

History
93 lines (65 loc) · 1.9 KB

File metadata and controls

93 lines (65 loc) · 1.9 KB

RequestTimeoutException

Namespace: BhrSdk\Exceptions
Extends: ClientException
HTTP Status Code: 408

Description

Request timeout

Usage

try {
    // API call that might fail with 408 status code
} catch (BhrSdk\Exceptions\RequestTimeoutException $e) {
    // Handle the exception
    echo $e->getMessage();
    
    // Access additional information
    $causes = $e->getPotentialCauses();
    $tips = $e->getDebuggingTips();
    
    // Access response data
    $responseHeaders = $e->getResponseHeaders();
    $responseBody = $e->getResponseBody();
}

Potential Causes

  • The server did not receive a complete request within the time it was prepared to wait
  • Network connectivity issues
  • Server overload or high latency

Debugging Tips

  • Check your network connection
  • Increase request timeout settings
  • Consider breaking large requests into smaller chunks
  • Increase the number of retries

Constructor

public function __construct(
    string $message,
    array $responseHeaders = [],
    $responseBody = null
)

Parameters

Name Type Description
$message string The error message
$responseHeaders array HTTP response headers from the API call
$responseBody mixed HTTP response body from the API call

Methods

getPotentialCauses()

Returns an array of potential causes for this exception.

public function getPotentialCauses(): array

getDebuggingTips()

Returns an array of debugging tips for this exception.

public function getDebuggingTips(): array

getResponseHeaders()

Returns the HTTP response headers from the API call that triggered this exception.

public function getResponseHeaders(): array

getResponseBody()

Returns the HTTP response body from the API call that triggered this exception.

public function getResponseBody()