(PECL yar >= 1.0.0)
Yar_Server_Exception::getType — ��ȡ�쳣��ԭʼ����
������˵ķ������׳��쳣��ʱ��, �ͻ��˱��ػ���Ӧ���׳�һ��Yar_Server_Exception�쳣. ��һ������, �����˷�����쳣������. ����������ǻ�ȡ����쳣����.
�˺���û�в�����
string
Example #1 Yar_Server_Exception::getType()ʾ��
//Server.php
<?php
class Custom_Exception extends Exception {};
class API {
public function throw_exception($name) {
throw new Custom_Exception($name);
}
}
$service = new Yar_Server(new API());
$service->handle();
?>
//Client.php
<?php
$client = new Yar_Client("http://host/api.php");
try {
$client->throw_exception("client");
} catch (Yar_Server_Exception $e) {
var_dump($e->getType());
var_dump($e->getMessage());
}
�������̵���������ڣ�
string(16) "Custom_Exception" string(6) "client"