本文整理汇总了PHP中s::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP s::getMessage方法的具体用法?PHP s::getMessage怎么用?PHP s::getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s
的用法示例。
在下文中一共展示了s::getMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_exception
/**
* Handle uncaught exceptions
*
* @param s $exception
* @return void
*/
public function handle_exception($exception)
{
// Build tracelist
$trace = $exception->getTrace();
foreach ($trace as $key => $stackPoint) {
// I'm converting arguments to their type
// (prevents passwords from ever getting logged as anything other than 'string')
$trace[$key]['args'] = array_map('gettype', $trace[$key]['args']);
}
$result = array();
foreach ($trace as $key => $stackPoint) {
$result[] = sprintf($traceline, $key, $stackPoint['file'], $stackPoint['line'], $stackPoint['function'], implode(', ', $stackPoint['args']));
}
print_r($result);
$data['%message%'] = $exception->getMessage();
$data['%file%'] = $exception->getFile();
$data['%line%'] = $exception->getLine();
$data['%type%'] = 'Exception';
$line = $this->prepare_line($data);
$this->send($line);
}