Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set a thread default uncaught exception handler that logs the exception

  • Loading branch information...
commit 89c91d81519d499654647480d7f357bb21b76781 1 parent 53e0d34
@matthieumorel matthieumorel authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java
View
9 subprojects/s4-core/src/main/java/org/apache/s4/core/Main.java
@@ -21,6 +21,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -77,6 +78,14 @@ public static void main(String[] args) {
private static void startNode(MainArgs mainArgs) {
try {
+ Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
+
+ @Override
+ public void uncaughtException(Thread t, Throwable e) {
+ logger.error("Uncaught exception in thread {}", t.getName(), e);
+
+ }
+ });
Injector injector;
InputStream commConfigFileInputStream;
InputStream coreConfigFileInputStream;
Please sign in to comment.
Something went wrong with that request. Please try again.