mirror of
https://github.com/KOHGYLW/kiftd-source.git
synced 2025-01-09 04:27:56 +08:00
修正了BUG,将项目向v1.0.3推进,增加了一些功能
This commit is contained in:
parent
5e85a8469d
commit
b728808a9a
@ -8,23 +8,24 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ControllerAdvice
|
||||
@RequestMapping({ "/errorController" })
|
||||
public class ErrorController
|
||||
{
|
||||
@Resource
|
||||
private FileBlockUtil fbu;
|
||||
@Resource
|
||||
private LogUtil lu;
|
||||
|
||||
@RequestMapping({ "/pageNotFound.do" })
|
||||
public String handleError(final HttpServletRequest request, final HttpServletResponse response) {
|
||||
return response.encodeURL("/prv/error.html");
|
||||
}
|
||||
|
||||
@ExceptionHandler({ Exception.class })
|
||||
public void handleException(final Exception e) {
|
||||
this.lu.writeException(e);
|
||||
this.fbu.checkFileBlocks();
|
||||
Printer.instance.print("\u5904\u7406\u8bf7\u6c42\u65f6\u53d1\u751f\u9519\u8bef\uff1a\n\r------\u4fe1\u606f------\n\r" + e.getMessage() + "\n\r------\u4fe1\u606f------");
|
||||
e.printStackTrace();
|
||||
}
|
||||
public class ErrorController {
|
||||
@Resource
|
||||
private FileBlockUtil fbu;
|
||||
@Resource
|
||||
private LogUtil lu;
|
||||
|
||||
@RequestMapping({ "/pageNotFound.do" })
|
||||
public String handleError(final HttpServletRequest request, final HttpServletResponse response) {
|
||||
return response.encodeURL("/prv/error.html");
|
||||
}
|
||||
|
||||
@ExceptionHandler({ Exception.class })
|
||||
public void handleException(final Exception e) {
|
||||
this.lu.writeException(e);
|
||||
this.fbu.checkFileBlocks();
|
||||
Printer.instance
|
||||
.print("\u5904\u7406\u8bf7\u6c42\u65f6\u53d1\u751f\u9519\u8bef\uff1a\n\r------\u4fe1\u606f------\n\r"
|
||||
+ e.getMessage() + "\n\r------\u4fe1\u606f------");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ public class ConfigureReader {
|
||||
Printer.instance.print("错误:文件系统路径[" + this.fileSystemPath + "]无效,该路径必须指向一个具备读写权限的文件夹。");
|
||||
return 3;
|
||||
}
|
||||
this.fileBlockPath = this.fileSystemPath + File.separator + "fileblocks";
|
||||
this.fileBlockPath = this.fileSystemPath + "fileblocks"+File.separator;
|
||||
final File fbFile = new File(this.fileBlockPath);
|
||||
if (!fbFile.isDirectory() && !fbFile.mkdirs()) {
|
||||
Printer.instance.print("错误:无法创建文件块存放区[" + this.fileBlockPath + "]。");
|
||||
|
@ -1,5 +1,5 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Sun Aug 12 15:33:50 CST 2018
|
||||
#Sun Aug 12 16:32:10 CST 2018
|
||||
version=1.0.2-SNAPSHOT
|
||||
groupId=kohgylw
|
||||
m2e.projectName=kiftd
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user