string - Java only get Exception name without StackTrace -
how can exception name without getting stack trace?
i using exception.tostring() convert thrown exception string, want exception name likenullpointerexception , not entire stack trace.
how can solve this?
exception.getclass().getsimplename(); note: not work in case if exception anonymous class (although have never seen anonymous exception in production code)
Comments
Post a Comment