修正异常处理和单元测试

This commit is contained in:
yunwuxin
2016-05-15 10:14:17 +08:00
parent 00b17411b6
commit f78ba76767
6 changed files with 36 additions and 48 deletions

View File

@@ -13,6 +13,8 @@ namespace think\exception;
use Exception;
use think\Config;
use think\Console;
use think\console\Output;
use think\Log;
use think\Response;
@@ -79,6 +81,15 @@ class Handle
}
}
/**
* @param $output
* @param Exception $e
*/
public function renderForConsole(Output $output, Exception $e)
{
(new Console)->renderException($e, $output);
}
/**
* @param HttpException $e
* @return \think\Response
@@ -110,8 +121,7 @@ class Handle
'code' => $this->getCode($exception),
'source' => $this->getSourceCode($exception),
'datas' => $this->getExtendData($exception),
'tables' => [
'tables' => [
'GET Data' => $_GET,
'POST Data' => $_POST,
'Files' => $_FILES,