public class Samebug extends Object
| Constructor and Description |
|---|
Samebug() |
| Modifier and Type | Method and Description |
|---|---|
static void |
handleUncaughtExceptions()
Install a default exception handler on the current thread.
|
static void |
handleUncaughtExceptions(Configuration config)
Install a default exception handler on the current thread, with the given
config
|
static void |
handleUncaughtExceptions(String applicationKey)
Install a default exception handler on the current thread, with the given
application key.
|
static void |
init()
Initialize a singleton notifier instance.
|
static void |
init(Configuration config)
Initialize a singleton notifier instance.
|
static void |
init(String applicationKey)
Initialize a singleton notifier instance.
|
static UUID |
notify(String message,
Throwable throwable)
Notify Samebug about an exception
|
static UUID |
notify(String message,
Throwable throwable,
Date timestamp)
Notify Samebug about an exception
|
static UUID |
notify(String message,
ThrowableProxy throwableProxy)
Notify Samebug about an exception
|
static UUID |
notify(String message,
ThrowableProxy throwableProxy,
Date timestamp)
Notify Samebug about an exception
|
public static void handleUncaughtExceptions()
throws NoConfigFileException,
MultipleConfigFileException,
BadAppKey,
BadServerAddress
In case of any error (properties file not found, multiple file found, wrong format of properties, missing obligatory entries) the constructed notifier will not function as intended.
public static void handleUncaughtExceptions(String applicationKey) throws BadAppKey
BadAppKeypublic static void handleUncaughtExceptions(Configuration config) throws BadAppKey, BadServerAddress
BadAppKeyBadServerAddresspublic static void init()
throws NoConfigFileException,
MultipleConfigFileException,
BadAppKey,
BadServerAddress
Constructs a singleton Samebug Notifier instance using the default configuration.
You only need to use this initialization method if you want to use
{Samebugnotify(String, Throwable) explicitly. Only the first
call has effect, every consecutive call is practically ignored.
Using explicit notifications is discouraged, one should rather use uncaught exception handler or logger appenders.
public static void init(String applicationKey) throws BadAppKey
Constructs a singleton Samebug Notifier instance with the given application key.
You only need to use this initialization method if you want to use
{Samebugnotify(String, Throwable) explicitly. Only the first
call has effect, every consecutive call is practically ignored.
Using explicit notifications is discouraged, one should rather use uncaught exception handler or logger appenders.
BadAppKeypublic static void init(Configuration config) throws BadAppKey, BadServerAddress
Constructs a singleton Samebug Notifier instance with the given config.
You only need to use this initialization method if you want to use
{Samebugnotify(String, Throwable) explicitly. Only the first
call has effect, every consecutive call is practically ignored.
Using explicit notifications is discouraged, one should rather use uncaught exception handler or logger appenders.
BadAppKeyBadServerAddresspublic static UUID notify(String message, Throwable throwable) throws NotifierException
message - custom message describing the eventthrowable - the caught exceptionNotifierExceptionpublic static UUID notify(String message, Throwable throwable, Date timestamp) throws NotifierException
message - custom message describing the eventthrowable - the caught exceptiontimestamp - the time of occurrenceNotifierExceptionpublic static UUID notify(String message, ThrowableProxy throwableProxy) throws NotifierException
message - custom message describing the eventthrowableProxy - proxy for the caught exceptionNotifierExceptionpublic static UUID notify(String message, ThrowableProxy throwableProxy, Date timestamp) throws NotifierException
message - custom message describing the eventthrowableProxy - proxy for the caught exceptiontimestamp - the time of occurrenceNotifierExceptionCopyright © 2014. All rights reserved.