Commit bb4e75e0 authored by Quxl's avatar Quxl

x

parent ba505a4b
...@@ -29,10 +29,10 @@ public class ExceptionHandler implements HandlerExceptionResolver { ...@@ -29,10 +29,10 @@ public class ExceptionHandler implements HandlerExceptionResolver {
logger.debug(ex.getMessage()); logger.debug(ex.getMessage());
} }
} else { } else {
mav.addAllObjects(Rjx.jsonErr().setMessage("未处理异常")); mav.addAllObjects(Rjx.jsonErr().set("stack", toStackString(ex)).setMessage("未处理异常"));
} }
} catch (Exception e) { } catch (Exception e) {
mav.addAllObjects(Rjx.jsonErr().setMessage("异常处理失败")); mav.addAllObjects(Rjx.jsonErr().set("stack", toStackString(e)).setMessage("异常处理失败"));
} finally { } finally {
if(displayInLog) { if(displayInLog) {
logger.error("", ex); logger.error("", ex);
......
...@@ -5,7 +5,6 @@ import java.sql.Connection; ...@@ -5,7 +5,6 @@ import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.ResultSetMetaData; import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -104,7 +103,7 @@ public class SqlTestController { ...@@ -104,7 +103,7 @@ public class SqlTestController {
return Rjx.jsonOk().setData(resultSetList); return Rjx.jsonOk().setData(resultSetList);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
return Rjx.jsonOk().setMessage(ExceptionHandler.toStackString(e).toString()); return Rjx.jsonOk().set("stack", ExceptionHandler.toStackString(e).toString());
} finally { } finally {
try { try {
if(connection != null && !connection.isClosed()) { 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