Java Exception Message exceptionSimpleDesc(final Exception e)

Here you can find the source of exceptionSimpleDesc(final Exception e)

Description

exception Simple Desc

License

Apache License

Declaration

public static String exceptionSimpleDesc(final Exception e) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String exceptionSimpleDesc(final Exception e) {
        StringBuffer sb = new StringBuffer();
        if (e != null) {
            sb.append(e.toString());/*from   ww w.  j a  v  a2 s. c  om*/

            StackTraceElement[] stackTrace = e.getStackTrace();
            if (stackTrace != null && stackTrace.length > 0) {
                StackTraceElement elment = stackTrace[0];
                sb.append(", ");
                sb.append(elment.toString());
            }
        }

        return sb.toString();
    }
}

Related

  1. exception(Throwable e)
  2. exception(Throwable t)
  3. exceptionMessage(Object... strings)
  4. exceptionMessage(Throwable e)
  5. exceptionStackTrace(Exception ex)