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(com.samebug.notifier.core.IConfiguration 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(com.samebug.notifier.core.IConfiguration config)
Initialize a singleton notifier instance.
|
static void |
init(String applicationKey)
Initialize a singleton notifier instance.
|
static com.samebug.notifier.core.IResponse |
notify(String message,
Throwable throwable)
Notify Samebug about an exception
|
static com.samebug.notifier.core.IResponse |
notify(String message,
Throwable throwable,
Date timestamp)
Notify Samebug about an exception
|
static com.samebug.notifier.core.IResponse |
notify(String message,
com.samebug.notifier.core.proxy.ThrowableProxy throwableProxy)
Notify Samebug about an exception
|
static com.samebug.notifier.core.IResponse |
notify(String message,
com.samebug.notifier.core.proxy.ThrowableProxy throwableProxy,
Date timestamp)
Notify Samebug about an exception
|
public static void handleUncaughtExceptions()
throws com.samebug.notifier.core.exceptions.NoConfigFileException,
com.samebug.notifier.core.exceptions.MultipleConfigFileException,
com.samebug.notifier.core.exceptions.BadConfigFile,
com.samebug.notifier.core.exceptions.BadHelpMode,
com.samebug.notifier.core.exceptions.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.
com.samebug.notifier.core.exceptions.NoConfigFileExceptioncom.samebug.notifier.core.exceptions.MultipleConfigFileExceptioncom.samebug.notifier.core.exceptions.BadConfigFilecom.samebug.notifier.core.exceptions.BadHelpModecom.samebug.notifier.core.exceptions.BadServerAddresspublic static void handleUncaughtExceptions(String applicationKey) throws com.samebug.notifier.core.exceptions.BadHelpMode
applicationKey - the application keycom.samebug.notifier.core.exceptions.BadHelpModepublic static void handleUncaughtExceptions(com.samebug.notifier.core.IConfiguration config)
config - the configurationpublic static void init()
throws com.samebug.notifier.core.exceptions.NoConfigFileException,
com.samebug.notifier.core.exceptions.MultipleConfigFileException,
com.samebug.notifier.core.exceptions.BadConfigFile,
com.samebug.notifier.core.exceptions.BadHelpMode,
com.samebug.notifier.core.exceptions.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.
com.samebug.notifier.core.exceptions.NoConfigFileExceptioncom.samebug.notifier.core.exceptions.MultipleConfigFileExceptioncom.samebug.notifier.core.exceptions.BadConfigFilecom.samebug.notifier.core.exceptions.BadHelpModecom.samebug.notifier.core.exceptions.BadServerAddresspublic static void init(String applicationKey) throws com.samebug.notifier.core.exceptions.BadHelpMode
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.
applicationKey - the application keycom.samebug.notifier.core.exceptions.BadHelpModepublic static void init(com.samebug.notifier.core.IConfiguration config)
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.
config - the configurationpublic static com.samebug.notifier.core.IResponse notify(String message, Throwable throwable) throws com.samebug.notifier.core.exceptions.NotifierException
message - custom message describing the eventthrowable - the caught exceptioncom.samebug.notifier.core.exceptions.NotifierException - when the underlying notifier throws an exceptionpublic static com.samebug.notifier.core.IResponse notify(String message, Throwable throwable, Date timestamp) throws com.samebug.notifier.core.exceptions.NotifierException
message - custom message describing the eventthrowable - the caught exceptiontimestamp - the time of occurrencecom.samebug.notifier.core.exceptions.NotifierException - when the underlying notifier throws an exceptionpublic static com.samebug.notifier.core.IResponse notify(String message, com.samebug.notifier.core.proxy.ThrowableProxy throwableProxy) throws com.samebug.notifier.core.exceptions.NotifierException
message - custom message describing the eventthrowableProxy - proxy for the caught exceptioncom.samebug.notifier.core.exceptions.NotifierException - when the underlying notifier throws an exceptionpublic static com.samebug.notifier.core.IResponse notify(String message, com.samebug.notifier.core.proxy.ThrowableProxy throwableProxy, Date timestamp) throws com.samebug.notifier.core.exceptions.NotifierException
message - custom message describing the eventthrowableProxy - proxy for the caught exceptiontimestamp - the time of occurrencecom.samebug.notifier.core.exceptions.NotifierException - when the underlying notifier throws an exceptionCopyright © 2015. All rights reserved.