Mac Systems
- Forum-Beiträge: 1.727
24.07.2010, 17:17:37 via Website
24.07.2010 17:17:37 via Website
1/**
2 * Returns a Throwable as a String, if Throwable is null the String "null"
3 * will be returned.
4 *
5 * @param aThrowable
6 * @return
7 */
8 public static String getStackTrace(final Throwable aThrowable)
9 {
10 if (aThrowable == null)
11 {
12 return "null";
13 }
14 final Writer result = new StringWriter();
15 final PrintWriter printWriter = new PrintWriter(result);
16 aThrowable.printStackTrace(printWriter);
17 return result.toString();
18 }
2 * Returns a Throwable as a String, if Throwable is null the String "null"
3 * will be returned.
4 *
5 * @param aThrowable
6 * @return
7 */
8 public static String getStackTrace(final Throwable aThrowable)
9 {
10 if (aThrowable == null)
11 {
12 return "null";
13 }
14 final Writer result = new StringWriter();
15 final PrintWriter printWriter = new PrintWriter(result);
16 aThrowable.printStackTrace(printWriter);
17 return result.toString();
18 }
- Mac
Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.