dounue1965 2014-02-01 17:38
浏览 27

处理未知状态代码[CakeException]未知状态代码

How would I handle gracefully failures of another http server i'm talking to via HttpSocket? Haven't been able to find any good examples

Stack Trace:
2014-02-01 07:00:35 Error: Fatal Error (256): [CakeException] Unknown status code
#0 /home/alterscape/lab/cakephp/lib/Cake/Error/ExceptionRenderer.php(212): CakeResponse-    >statusCode(110)
#1 [internal function]: ExceptionRenderer->error400(Object(SocketException))
#2 /home/alterscape/lab/cakephp/lib/Cake/Error/ExceptionRenderer.php(175): call_user_func_array(Array, Array)
#3 /home/alterscape/lab/cakephp/lib/Cake/Error/ErrorHandler.php(120): ExceptionRenderer->render()
#4 [internal function]: ErrorHandler::handleException(Object(SocketException))
#5 {main} in [/home/alterscape/lab/cakephp/lib/Cake/Error/ErrorHandler.php, line 129]

2014-02-01 07:00:35 Error: [InternalErrorException] Internal Server Error

StackTrace
#0 /home/alterscape/lab/cakephp/lib/Cake/Routing/Dispatcher.php(185): Controller->invokeAction(Object(CakeRequest))
#1 /home/alterscape/lab/cakephp/lib/Cake/Routing/Dispatcher.php(160): Dispatcher->_invoke(Object(SecurityLogsController), Object(CakeRequest), Object(CakeResponse))
#2 /home/alterscape/lab/cakephp/app/webroot/index.php(108): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#3 {main}
2014-02-01 07:00:35 Error: [SocketException] Connection timed out
  • 写回答

1条回答 默认 最新

  • duanju9104 2014-07-28 10:57
    关注

    The [CakeException] Unknown status code is caused because CakePHP doesn't recognize Error Code 110. Check out:

    http://api.cakephp.org/2.3/source-class-CakeResponse.html#601-617

    Here's a way to add your custom HTTP code to cake's approved list. I use this in AppController.

    http://api.cakephp.org/2.3/class-CakeResponse.html#_httpCodes

    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序