Package com.anylogic.engine
- java.lang.Object
- com.anylogic.engine.UtilitiesError
@AnyLogicInternalAPI public final class UtilitiesError extends Object
Modifier and Type | Method | Description |
---|---|---|
static <T extends Throwable> | dropLastFromStack |
Removes last element from stack trace of the given throwable
This method may be used in private check/ensure-methods |
static <T extends Throwable> | dropLastFromStack |
Removes last elements from stack trace of the given throwable
This method may be used in private check/ensure-methods |
static RuntimeException | error |
Creates and throws new
RuntimeException |
static RuntimeException | error |
Creates and throws new
RuntimeException with message using format syntax like
in String.format(String, Object...) method |
static RuntimeException | error |
Creates and throws new
RuntimeException |
static RuntimeException | error |
Creates and throws new
RuntimeException with message using format syntax like
in String.format(String, Object...) method |
static String | formatSafe |
Safe analog of
String.format(String, Object...) . |
static Class<?> | getClassSafe | |
static void | processThreadDeath |
Rethrows e if it is
ThreadDeath |
static String | toStringSafe | |
static String | toStringStackTrace |
public static RuntimeException error(String errorText)
Creates and throws new
RuntimeException
public static RuntimeException error(Throwable cause, String errorText)
Creates and throws new
RuntimeException
public static RuntimeException error(Throwable cause, String errorTextFormat, Object... args)
Creates and throws new
RuntimeException
with message using format syntax like
in String.format(String, Object...)
method- See Also:
public static RuntimeException error(String errorTextFormat, Object... args)
Creates and throws new
RuntimeException
with message using format syntax like
in String.format(String, Object...)
method- See Also:
public static <T extends Throwable> T dropLastFromStack(T throwable)
Removes last element from stack trace of the given throwable
This method may be used in private check/ensure-methods
This method may be used in private check/ensure-methods
- Type Parameters:
T
-- Parameters:
throwable
-- Returns:
- given
throwable
, for convenience
public static <T extends Throwable> T dropLastFromStack(T throwable, int count)
Removes last elements from stack trace of the given throwable
This method may be used in private check/ensure-methods
This method may be used in private check/ensure-methods
- Type Parameters:
T
-- Parameters:
throwable
-- Returns:
- given
throwable
, for convenience
@AnyLogicInternalAPI public static void processThreadDeath(Throwable e)
Rethrows e if it is
ThreadDeath
- Parameters:
e
-- See Also:
-
ThreadDeath
public static String formatSafe(String messageFormat, Object... messageArgs)
Safe analog of
String.format(String, Object...)
. Doesn't fail in case of message format errors.public static String toStringStackTrace(Throwable e)
- Returns:
- stack trace as a string
public static String toStringSafe(Object o)
public static Class<?> getClassSafe(Object obj)