php8.5
Home/ Manual/ yar / yar_client_exception/ Yar_Client_Exception::getType

Yar_Client_Exception::getType

PHP function Edit on GitHub ✎

(PECL yar >= 1.0.0)

Retrieve exception's type

Description

Yar_Client_Exception::getType(): string

Returns the type of the exception. Client-side exceptions are raised by the client itself (transport failures, protocol errors and so on), so the type is always the fixed string "Yar_Exception_Client". Use Exception::getCode to tell the individual failure apart; the code is one of the YAR_ERR_* constants.

Parameters Parameters

Return Values

Returns "Yar_Exception_Client".

Examples

Yar_Client_Exception::getType example

php
<?php
$client = new Yar_Client("http://api.example.com/operator.php");

try {
    $client->some_method("parameter");
} catch (Yar_Client_Exception $e) {
    var_dump($e->getType());
    var_dump($e->getCode());
}
?>

The above example will output something similar to:

output
string(20) "Yar_Exception_Client"
int(16)

See Also

  • Yar_Server_Exception::getType

Source: reference/yar/yar_client_exception/gettype.xml · from the official PHP manual (php/doc-en)