This method converts a java Throwable into a "user friendly" error message.

@param throwable the Throwable to convert
@return A {@link Message} containing the hard coded description "The system is currently unavailable."
507623
@Override
	public Message toMessage(final Throwable throwable) {
		LOG.error("The system is currently unavailable", throwable);
		return new Message(Message.ERROR_MESSAGE, InternalMessages.DEFAULT_SYSTEM_ERROR);
	}
727509
public static boolean isFromOrSuppressedThrowable(Throwable throwable, Class<? extends Throwable> exceptionClass) {
		return convertFromOrSuppressedThrowable(throwable, exceptionClass, true) != null;
	}
60283
public static String convertExceptionToMessage(Throwable ex)
  {
    StringBuilder sb = new StringBuilder();
    if(ex != null)
    {
      sb.append("Exception type: ").append(ex.getClass().getName()).append("\n");
      sb.append("Message: ").append(ex.getLocalizedMessage()).append("\n");
      sb.append("Stacktrace: \n");
      StackTraceElement[] st = ex.getStackTrace();
      for (int i = 0; i < st.length; i++)
      {
        sb.append(st[i].toString());
        sb.append("\n");
      }
    }
    return sb.toString();
  }
900811
public static String getExceptionMessage(Throwable exception)
    {
        StringWriter        out = new StringWriter();
        exception.printStackTrace(new PrintWriter(out));
        BufferedReader      in = new BufferedReader(new StringReader(out.toString()));
        try
        {
            StringBuilder       str = new StringBuilder();
            for(;;)
            {
                String  line = in.readLine();
                if ( line == null )
                {
                    break;
                }
                if ( str.length() > 0 )
                {
                    str.append(", ");
                }
                str.append(line);
            }
            return str.toString();
        }
        catch ( IOException e )
        {
            // ignore
        }
        return "n/a";
    }
936125
public static List<Throwable> getCausalChain(final Throwable throwable) {
		if (throwable == null) {
			throw new NullPointerException("Throwable is null");
		}
		
		List<Throwable> causes = new ArrayList<Throwable>();
		causes.add(throwable);
		
		Throwable cause = throwable.getCause();
		
		while ((cause != null) && (!causes.contains(cause))) {
			causes.add(cause);
			cause = cause.getCause();
		}
		
		return causes;
	}
1320937
public static <T, X extends Throwable> Try<T, X> failure(final X error) {
        return new Try<>(Either.left(
            error),new Class[0]);
    }
897755
private int checkLinkAbleToExceptionMessage()
                    throws SIException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "checkLinkAbleToExceptionMessage");

        int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;

        blockingReason = checkCanExceptionMessage(_destination);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "checkLinkAbleToExceptionMessage", Integer.valueOf(blockingReason));

        return blockingReason;
    }
234807
public static Throwable unwrapForPresentation(Throwable throwable) {
        if (throwable == null) {
            return null;
        }
        while (throwable instanceof ExecutionException || throwable instanceof IllegalStateException
                || throwable.getClass() == RuntimeException.class) {
            // unwrap causes from wrapping exceptions
            final Throwable cause = throwable.getCause();
            if (cause == null) {
                break;
            }
            final String message = throwable.getMessage();
            if (Strings.isNullOrEmpty(message) || cause.toString().equals(message)) {
                // run another iteration
                throwable = cause;
            } else {
                break;
            }
        }
        return throwable;
    }
599644
public static <T> CompletableFuture<T> getFailedFuture(Throwable throwable) {
		CompletableFuture<T> failedAttempt = new CompletableFuture<>();
		failedAttempt.completeExceptionally(throwable);
		return failedAttempt;
	}
616857
public static Throwable getCause(final Throwable throwable) {
        // Unwrap possibly-nested ExecutionExceptions to get to root cause
        Throwable cause = throwable;
        while (cause instanceof ExecutionException) {
            cause = cause.getCause();
        }
        return cause != null ? cause : new ExecutionException("ExecutionException with unknown cause", null);
    }
1130205
private final static boolean pstRecursesOnNested(Throwable t) {
        //This method added for D200273

        // the following Throwables don't print out the nested throwable when printStackTrace is called
        Class cName = t.getClass();
        if (cName.getName() != null && cName.getName().equals("org.omg.CORBA.portable.UnknownException"))
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.mail.MessagingException"))
            return false;
        if (t instanceof org.xml.sax.SAXException)
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.servlet.jsp.JspException"))
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.servlet.ServletException"))
            return false;
        if (t instanceof javax.naming.NamingException)
            return false;
        if (t instanceof java.sql.SQLException)
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.jms.JMSException"))
            return false;

        return true;
    }
215163
public static void showException(Throwable throwable) {
		throwable.printStackTrace(getSystemErrorStream());
		JOptionPane.showMessageDialog(null, throwable.toString(),
				UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE);
		// on pourrait affichage une boîte de dialogue plus évoluée pour permettre d'afficher la stack trace en détail
	}
1195667
public static ErrorDetails exceptionName( Throwable t ) {
		return new ErrorDetails( t.getClass().getName(), ErrorDetailsKind.EXCEPTION_NAME );
	}
949049
public void error(final String message, final Throwable throwable) {
        log.error(sanitize(message), throwable);
    }
205993
@Deprecated
  public static void reportException(final Throwable throwable, final String level) {
    reportException(throwable, level, null, null);
  }
1247467
protected Throwable unwrap(Throwable throwable) {
        if (throwable instanceof ExecutionException && throwable.getCause() != null) {
            return throwable.getCause();
        }
        return throwable;
    }
803400
private String getExceptionMessage(Throwable pException) {
        String message = pException.getLocalizedMessage();
        return pException.getClass().getName() + (message != null ? " : " + message : "");
    }