我使用FlashBuilder工具創建了一個Zend AMF服務。我想嘗試的是改變其中一個自動創建的方法來拋出異常,以便查看行爲。而不是異常被序列化回我的Flex應用程序,它給了我以下內容:Zend AMF和異常處理
[RPC Fault faultString =「Channel disconnected」faultCode =「Client.Error.DeliveryInDoubt」faultDetail = ] at mx.rpc :: AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal :: faultHandler()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ Mx \ rpc \ AbstractInvoker.as:345] at mx.rpc :: Responder/fault()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ mx \ rpc \ Responder.as:68]在NetConnectionMessageResponder/channelDisconnectHandler()上的mx.rpc :: AsyncRequest/fault()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ mx \ rpc \ AsyncRequest.as:113] \ dev的\ 4.0.0 \框架\項目\ RPC \ SRC \ MX \消息\通道\ NetConnectionChannel.as :684] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.messaging :: Channel/disconnectSuccess()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ mx \ messaging \ Channel.as:1214] at mx.messaging.channels :: NetConnectionChannel/internalDisconnect()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ mx \ messages \ channels \ NetConnectionChannel.as:175] at mx.messaging.channels :: AMFChannel/internalDisconnect()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ mx \ messaging \ channels \ AMFChannel .as:355] at mx.messaging.channels :: AMFChannel/statusHandler()[E:\ dev \ 4.0.0 \ frameworks \ projects \ rpc \ src \ mx \ messaging \ channels \ AMFChannel.as:445]
通道斷開...
[RPC故障faultString = 「通道斷開」 的faultcode = 「Client.Error.DeliveryInDoubt」 faultDetail = 「通道斷開收到確認之前」]
這是代碼:
公共職能getAllUser(){
$stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$rows = array();
mysqli_stmt_bind_result($stmt, $row->id, $row->user_group_id, $row->username, $row->password, $row->active, $row->activation_key, $row->timezone, $row->created_on, $row->modified_on);
while (mysqli_stmt_fetch($stmt)) {
$row->created_on = new DateTime($row->created_on);
$row->modified_on = new DateTime($row->modified_on);
$rows[] = $row;
$row = new stdClass();
mysqli_stmt_bind_result($stmt, $row->id, $row->user_group_id, $row->username, $row->password, $row->active, $row->activation_key, $row->timezone, $row->created_on, $row->modified_on);
}
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
$errorCode = 1;
throw(new Exception('the error message you want', $errorCode));
return $rows;
}
通知throw語句:
throw(new Exception('the error message you want',$ errorCode));
我真的沒有想到這一點。我怎樣才能使它工作?
謝謝高級!!!