图片在附件中,怎样才能获取红色方块中detailmessage的值呢?非常感谢!
捕获到这个异常 就可以拿到的!
你打印下试试
通过try-catch捕捉到该异常后,再通过e.getMessage()方法就可以得到detailmessage信息了。
我的解决方法是
[code="java"]StringWriter sw=new StringWriter();
PrintWriter pw=new PrintWriter(sw);
ex.printStackTrace(pw);[/code]
然后[code="java"]sw.tostring()[/code]就可以了。
我的项目中的日志就是这样做的