Yii Framework Forum: YII的异常处理过程 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

YII的异常处理过程 Rate Topic: -----

#1 User is offline   persistence 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 46
  • Joined: 02-January 10

Posted 09 March 2011 - 02:39 AM

CErrorHandler

异常处理组件与CApplication一起配合来处理所有异常(未捕获的)。通过下图可以看出,CApplication将它的handleException/handleError方法注册为事件处理句柄,即CApplication得到所有的异常,然后将它交给异常处理组件处理。异常处理最主要的工作是给浏览器端展示异常,一般都是将异常交给某个Action来展示:如果是正常请求,就返回一个异常页面;如果是ajax请求,就返回一个json,由浏览器端的javascript对json进行展示。

Posted Image
1

#2 User is offline   axgle 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 11-April 10

Posted 09 March 2011 - 04:09 AM

喜欢图文并茂的帖子,不错.
1

#3 User is offline   starsw001 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 02-March 11

Posted 10 March 2011 - 03:26 AM

学习下。。。
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users