Browse Source

Optimize exception output
优化异常输出

star7th 5 years ago
parent
commit
127e8ae8ef
2 changed files with 9 additions and 0 deletions
  1. 8 0
      Public/exception.tpl
  2. 1 0
      server/Application/Common/Conf/config.php

+ 8 - 0
Public/exception.tpl

@@ -0,0 +1,8 @@
+<?php
+    echo json_encode(
+    	array(
+    		"error_code"=>999,
+    		"error_message" =>strip_tags($e['message'])." 。错误位置:".$e['file']."  ".$e['line'] 
+    		)
+    )
+?>

+ 1 - 0
server/Application/Common/Conf/config.php

@@ -26,6 +26,7 @@ return array(
     'STATS_CODE' =>'',  //可选,统计代码
     'TMPL_CACHE_ON' => false,//禁止模板编译缓存
     'HTML_CACHE_ON' => false,//禁止静态缓存
+    'TMPL_EXCEPTION_FILE' => '../Public/exception.tpl' , //错误模版
     //上传文件到七牛的配置
     'UPLOAD_SITEIMG_QINIU' => array(
                     'maxSize' => 5 * 1024 * 1024,//文件大小