Here you can find the source of formatException(Throwable th)
Parameter | Description |
---|---|
th | the throwable to process |
public static String formatException(Throwable th)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w . j a v a 2s. c o m * Format the information from a Throwable as string, retaining the type and its message. * * @param th the throwable to process * @return string with the type of the Throwable and its message, e.g. "[IOException]: Could not open stream" */ public static String formatException(Throwable th) { return "[" + th.getClass().getSimpleName() + "]: " + th.getMessage(); } }