All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webpieces.webserver.api.WebpiecesExceptionHandler Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package org.webpieces.webserver.api;

import java.lang.Thread.UncaughtExceptionHandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class WebpiecesExceptionHandler implements UncaughtExceptionHandler {

	private static final Logger log = LoggerFactory.getLogger(WebpiecesExceptionHandler.class);

	@Override
	public void uncaughtException(Thread t, Throwable e) {
		if("main".equals(t.getName())) {
			log.error("Your main threaad jsut died due to an exception", e);
			return;
		}
		
		log.error("This could be VERY Bad, your thread may have died DEAD and won't run!!\n"
				+ "Install a try catch to not see this last ditch effor of a warning.\n"
				+ "Uncaught Exception. thread="+t.getName(), e);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy