public static InvalidFormulaInContextException fromThrowable(String message, Throwable cause) {
    return (cause instanceof InvalidFormulaInContextException && Objects.equals(message, cause.getMessage()))
                   ? (InvalidFormulaInContextException) cause
                   : new InvalidFormulaInContextException(message, cause);
  }
public static InvalidFormulaInContextException fromThrowable ( String message , Throwable cause ) { return ( cause instanceof InvalidFormulaInContextException && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( InvalidFormulaInContextException ) cause : new InvalidFormulaInContextException ( message , cause ) ; }
Converts a Throwable to a InvalidFormulaInContextException with the specified detail message. If the
Throwable is a InvalidFormulaInContextException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new InvalidFormulaInContextException with the detail message.

@param cause       the Throwable to convert
@param message the specified detail message

@return a InvalidFormulaInContextException