public class Exceptions
extends Object
Internal exception helpers used by the JSON parser implementation.
| Modifiers | Name | Description |
|---|---|---|
static class |
Exceptions.JsonInternalException |
Runtime exception used inside the JSON internals to simplify propagation. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static boolean |
die()Throws a generic internal JSON exception. |
|
public static boolean |
die(String message)Throws an internal JSON exception with the supplied message. |
<T> |
public static T |
die(Class<T> clazz, String message)Throws an internal JSON exception with the supplied message. |
|
public static void |
handle(Exception e)Rethrows the supplied exception as an internal JSON exception. |
<T> |
public static T |
handle(Class<T> clazz, Exception e)Rethrows the supplied exception as an internal JSON exception. |
<T> |
public static T |
handle(Class<T> clazz, String message, Throwable e)Rethrows the supplied throwable as an internal JSON exception with a message. |
|
public static void |
handle(String message, Throwable e)Rethrows the supplied throwable as an internal JSON exception with a message. |
|
public static String |
sputs(CharBuf buf, Object messages)Appends messages to the supplied buffer and returns its current contents. |
|
public static String |
sputs(Object messages)Creates a temporary buffer, appends the supplied messages, and returns the result. |
|
public static String |
toString(Exception ex)Formats an exception and its stack trace for debug output. |
Throws a generic internal JSON exception.
Throws an internal JSON exception with the supplied message.
message - the failure messageThrows an internal JSON exception with the supplied message.
clazz - the ignored target type used for generic flowmessage - the failure messageT - the generic return typeRethrows the supplied exception as an internal JSON exception.
e - the exception to wrapRethrows the supplied exception as an internal JSON exception.
clazz - the ignored target type used for generic flowe - the exception to wrapT - the generic return typeRethrows the supplied throwable as an internal JSON exception with a message.
clazz - the ignored target type used for generic flowmessage - the failure messagee - the throwable to wrapT - the generic return typeRethrows the supplied throwable as an internal JSON exception with a message.
message - the failure messagee - the throwable to wrapAppends messages to the supplied buffer and returns its current contents.
buf - the destination buffermessages - the messages to appendCreates a temporary buffer, appends the supplied messages, and returns the result.
messages - the messages to append