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

com.linkedin.r2.util.UncaughtExceptionHandler Maven / Gradle / Ivy

Go to download

Pegasus is a framework for building robust, scalable service architectures using dynamic discovery and simple asychronous type-checked REST + JSON APIs.

The newest version!
/**
 * $Id: $
 */

package com.linkedin.r2.util;

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

/**
 * UncaughtExceptionHandler
 *
 * This class can be set on a thread to log uncaught exceptions.
 *
 * @see Thread#setUncaughtExceptionHandler
 *
 * @author David Hoa
 * @version $Revision: $
 */

public class UncaughtExceptionHandler implements Thread.UncaughtExceptionHandler
{
  private static final Logger _log = LoggerFactory.getLogger(UncaughtExceptionHandler.class);

  @Override
  public void uncaughtException(Thread t, Throwable e)
  {
    _log.error("exception from thread: " + t, e);
    throw new RuntimeException(e);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy