首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

rails错误(异常)处理

2012-11-19 
rails异常(错误)处理方法1:http://www.uedidea.com/rails%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86.html?????

rails异常(错误)处理

方法1:http://www.uedidea.com/rails%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86.html

?

?

?



?? hlee 在文中还提到可以这样做:

?

方法3:rescue_action_in_public



参考:http://202.199.224.30/post/article/7

    DEFAULT_RESCUE_RESPONSE = :internal_server_error      DEFAULT_RESCUE_RESPONSES = {        'ActionController::RoutingError'             => :not_found,        'ActionController::UnknownAction'            => :not_found,        'ActiveRecord::RecordNotFound'               => :not_found,        'ActiveRecord::StaleObjectError'             => :conflict,        'ActiveRecord::RecordInvalid'                => :unprocessable_entity,        'ActiveRecord::RecordNotSaved'               => :unprocessable_entity,        'ActionController::MethodNotAllowed'         => :method_not_allowed,        'ActionController::NotImplemented'           => :not_implemented,        'ActionController::InvalidAuthenticityToken' => :unprocessable_entity      }            DEFAULT_RESCUE_TEMPLATE = 'diagnostics'      DEFAULT_RESCUE_TEMPLATES = {        'ActionView::MissingTemplate'       => 'missing_template',        'ActionController::RoutingError'    => 'routing_error',        'ActionController::UnknownAction'   => 'unknown_action',        'ActionView::TemplateError'         => 'template_error'      }  
?




又看了这篇贴子中的讨论:http://www.iteye.com/topic/708334
rails的错误处理还需要再研究。

?

热点排行
Bad Request.