Turn a stack trace into a string?

后端 未结 4 803
日久生厌
日久生厌 2021-01-08 00:23

Is it possible to print a stack trace to a string in GWT? The usual methods of using the classes in java.io won\'t work I think, because the java.io package is not available

4条回答
  •  死守一世寂寞
    2021-01-08 00:54

    I'm not sure if StackTraceElement is emulated, but if it is you can run something like

    for (StackTraceElement element : exception.getStackTrace()) {
        string += element + "\n";
    }
    

提交回复
热议问题