Java Exception Format formatMessage(Exception e)

Here you can find the source of formatMessage(Exception e)

Description

format Message

License

BSD License

Declaration

public static String formatMessage(Exception e) 

Method Source Code

//package com.java2s;
//The contents of this file are subject to the "Simplified BSD License" (the "License");

public class Main {
    public static String formatMessage(Exception e) {
        String msg = e.getMessage();
        Throwable cause = e.getCause();
        if (cause != null)
            msg = msg + "\nCause: " + cause.getMessage();
        return msg;
    }// w ww  . jav  a2 s.c  om
}

Related

  1. formatException(Throwable exception)
  2. formatException(Throwable th)
  3. formatExceptionMsg(String msg)
  4. formatJavaException(Exception e)
  5. formatLogMessage(long id, Throwable exception)
  6. formatStackTrace(Exception error)