Friday 8 March 2019

Java: Convert throwable to string


    public static String getString(Throwable t) {
        StringWriter sw = new StringWriter();
        t.printStackTrace(new PrintWriter(sw));
        return sw.toString();

    }

You may like

No comments:

Post a Comment