Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yar_Client_ExceptionYar_Client_Packager_Exception>
^Yar_Client_ExceptionLast updated: Mon, 26 Oct 2026

Yar_Client_Exception::getType

(PECL yar >= 1.0.0)

Yar_Client_Exception::getType — Retrieve exception's type

Description

public function 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

This function has no parameters.

Return Values

Returns "Yar_Exception_Client".

Examples

Example #1 Yar_Client_Exception::getType() example

<?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:

string(20) "Yar_Exception_Client"
int(16)

See Also


<Yar_Client_ExceptionYar_Client_Packager_Exception>
^Yar_Client_ExceptionLast updated: Mon, 26 Oct 2026