when you are using xdebug, exceptions message will never be shown if you use any encoding different than UTF-8, so if you are using any database with translated messages like oracle, you should ALWAYS, always, throw a exception like this
throw new Exception(utf8_encode($message),$code), character like ã,é,ç, will make the exception message fail to be shown, if you are not using xdebug ( I do think you should at least try), this code will not affect your page.
Exception
(PHP 5 >= 5.1.0)
简介
Exception是所有异常的基类。
类摘要
Exception
{
/* 属性 */
/* 方法 */
}属性
- message
-
异常消息内容
- code
-
异常代码
- file
-
抛出异常的文件名
- line
-
抛出异常在该文件中的行号
Table of Contents
- Exception::__construct — 异常构造函数
- Exception::getMessage — 获取异常消息内容
- Exception::getPrevious — 返回异常链中的前一个异常
- Exception::getCode — 获取异常代码
- Exception::getFile — 获取发生异常的程序文件名称
- Exception::getLine — 获取发生异常的代码在文件中的行号
- Exception::getTrace — 获取异常追踪信息
- Exception::getTraceAsString — 获取字符串类型的异常追踪信息
- Exception::__toString — 将异常对象转换为字符串
- Exception::__clone — 异常克隆
altieresdelsent at gmail dot com ¶
8 months ago
