summaryrefslogtreecommitdiff
path: root/app/src/main/java/no/topi/fiken/display/ExceptionHandler.java
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2014-11-30 23:55:54 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2014-12-01 00:17:04 +0100
commit7a7d015f8a68f5e0d06fe6e3d9422d5f418f653d (patch)
tree35d8a59e3d5ae1e0b600d91b2ac4283380bdc896 /app/src/main/java/no/topi/fiken/display/ExceptionHandler.java
downloadfiken-display-android-7a7d015f8a68f5e0d06fe6e3d9422d5f418f653d.tar.gz
fiken-display-android-7a7d015f8a68f5e0d06fe6e3d9422d5f418f653d.tar.bz2
fiken-display-android-7a7d015f8a68f5e0d06fe6e3d9422d5f418f653d.tar.xz
fiken-display-android-7a7d015f8a68f5e0d06fe6e3d9422d5f418f653d.zip
o Initial import of Fiken Status Display app.
Diffstat (limited to 'app/src/main/java/no/topi/fiken/display/ExceptionHandler.java')
-rw-r--r--app/src/main/java/no/topi/fiken/display/ExceptionHandler.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/src/main/java/no/topi/fiken/display/ExceptionHandler.java b/app/src/main/java/no/topi/fiken/display/ExceptionHandler.java
new file mode 100644
index 0000000..3d4560b
--- /dev/null
+++ b/app/src/main/java/no/topi/fiken/display/ExceptionHandler.java
@@ -0,0 +1,22 @@
+package no.topi.fiken.display;
+
+import android.util.Log;
+
+public class ExceptionHandler implements Thread.UncaughtExceptionHandler {
+ private final static String TAG = DefaultDisplayService.class.getSimpleName();
+
+ public static final ExceptionHandler EXCEPTION_HANDLER = new ExceptionHandler();
+
+ @Override
+ public void uncaughtException(Thread thread, Throwable ex) {
+ Log.e(TAG, "Uncaught", ex);
+
+ if (ex instanceof RuntimeException) {
+ throw (RuntimeException) ex;
+ }
+ if (ex instanceof Error) {
+ throw (Error) ex;
+ }
+ throw new RuntimeException(ex);
+ }
+}