增加http助手函数 改进App类

This commit is contained in:
thinkphp
2016-05-29 23:07:24 +08:00
parent eadaef6425
commit d122bad9b6
5 changed files with 18 additions and 6 deletions

View File

@@ -11,6 +11,8 @@
namespace think;
use think\exception\HttpException;
class Loader
{
// 类名映射
@@ -319,7 +321,7 @@ class Loader
} elseif ($empty && class_exists($emptyClass = self::parseClass($module, $layer, $empty, $appendSuffix))) {
return new $emptyClass(Request::instance());
} else {
throw new Exception('class [ ' . $class . ' ] not exists', 10001);
throw new HttpException(404, 'class [ ' . $class . ' ] not exists');
}
}