Commit bb4e75e0 authored by Quxl's avatar Quxl

x

parent ba505a4b
......@@ -29,10 +29,10 @@ public class ExceptionHandler implements HandlerExceptionResolver {
logger.debug(ex.getMessage());
}
} else {
mav.addAllObjects(Rjx.jsonErr().setMessage("未处理异常"));
mav.addAllObjects(Rjx.jsonErr().set("stack", toStackString(ex)).setMessage("未处理异常"));
}
} catch (Exception e) {
mav.addAllObjects(Rjx.jsonErr().setMessage("异常处理失败"));
mav.addAllObjects(Rjx.jsonErr().set("stack", toStackString(e)).setMessage("异常处理失败"));
} finally {
if(displayInLog) {
logger.error("", ex);
......
......@@ -5,7 +5,6 @@ import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
......@@ -104,7 +103,7 @@ public class SqlTestController {
return Rjx.jsonOk().setData(resultSetList);
} catch (Throwable e) {
e.printStackTrace();
return Rjx.jsonOk().setMessage(ExceptionHandler.toStackString(e).toString());
return Rjx.jsonOk().set("stack", ExceptionHandler.toStackString(e).toString());
} finally {
try {
if(connection != null && !connection.isClosed()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment