(PECL yar >= 1.0.0)
Yar_Server_Exception::getType — 锟斤拷取锟届常锟斤拷原始锟斤拷锟斤拷
锟斤拷锟斤拷锟斤拷说姆锟斤拷锟斤拷锟斤拷壮锟斤拷斐o拷锟绞憋拷锟�, 锟酵伙拷锟剿憋拷锟截伙拷锟斤拷应锟斤拷锟阶筹拷一锟斤拷Yar_Server_Exception锟届常. 锟斤拷一锟斤拷锟斤拷锟斤拷, 锟斤拷锟斤拷锟剿凤拷锟斤拷锟斤拷斐o拷锟斤拷锟斤拷锟�. 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷腔锟饺★拷锟斤拷锟届常锟斤拷锟斤拷.
锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷
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"