Codota Logo
UncaughtExceptionHandler
Code IndexAdd Codota to your IDE (free)

How to use
UncaughtExceptionHandler
in
com.nilhcem.fakesmtp.core.exception

Best Java code snippets using com.nilhcem.fakesmtp.core.exception.UncaughtExceptionHandler (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 ThreadPoolExecutor exec = new ThreadPoolExecutor...;

exec.setThreadFactory(new ExceptionCatchingThreadFactory(exec.getThreadFactory()));
//go on to submit tasks...


private static class ExceptionCatchingThreadFactory implements ThreadFactory {
  private final ThreadFactory delegate;

  private ExceptionCatchingThreadFactory(ThreadFactory delegate) {
    this.delegate = delegate;
  }

  public Thread newThread(final Runnable r) {
    Thread t = delegate.newThread(r);
    t.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
      @Override
      public void uncaughtException(Thread t, Throwable e) {
        e.printStackTrace();  //replace with your handling logic.
      }
    });
    return t;
  }
}
origin: Nilhcem/FakeSMTP

((UncaughtExceptionHandler) Thread.getDefaultUncaughtExceptionHandler()).setParentComponent(panel.get());
Dimension frameSize = new Dimension(Integer.parseInt(Configuration.INSTANCE.get("application.min.width")),
  Integer.parseInt(Configuration.INSTANCE.get("application.min.height")));
origin: Nilhcem/FakeSMTP

/**
 * Called when an uncaught exception is thrown. Will display the error message in a dialog box.
 *
 * @param t the thread where the exception was throws.
 * @param e the thrown exception.
 */
@Override
public void uncaughtException(final Thread t, final Throwable e) {
  try {
    if (SwingUtilities.isEventDispatchThread()) {
      showException(t, e);
    } else {
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          showException(t, e);
        }
      });
    }
  } catch (Exception excpt) {
    LOGGER.error("", excpt);
  }
}
origin: stackoverflow.com

 public MyBroadcastReceiver() {
  final UncaughtExceptionHandler defaultUEH = Thread
      .getDefaultUncaughtExceptionHandler();
  Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
    @Override
    public void uncaughtException(Thread thread, Throwable ex) {
      // TODO Handle Exception
      defaultUEH.uncaughtException(thread, ex);
    }
  });
}
origin: stackoverflow.com

Thread.setDefaultUncaughtExceptionHandler( new UncaughtExceptionHandler() {
  @Override
  public void uncaughtException(Thread thread, Throwable exception) {
      defaultHandler.uncaughtException( thread, exception );
origin: Nilhcem/FakeSMTP

Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());
origin: stackoverflow.com

 @Override
public void onCreate() {
  super.onCreate();
  Crashlytics.start(this);
  initUncaughtExceptionHandler();
}

private void initUncaughtExceptionHandler() {
  final ScheduledThreadPoolExecutor c = new ScheduledThreadPoolExecutor(1);
  c.schedule(new Runnable() {
    @Override
    public void run() {
      final UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
      Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread paramThread, Throwable paramThrowable) {
          // do my amazing stuff here 
          System.err.println("Error!");
          //then pass the job to the previous handler
          defaultHandler.uncaughtException(paramThread, paramThrowable);
        }
      });
    }
  }, 5, TimeUnit.SECONDS);
}
origin: stackoverflow.com

 Thread.currentThread().setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

    @Override
    public void uncaughtException(Thread thread, Throwable ex) {
...
origin: stackoverflow.com

 GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
 public void onUncaughtException(Throwable e) {
  // TODO Global Exception Handling ...
 }
});
origin: stackoverflow.com

 public class ForceClose extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(this));

  setContentView(R.layout.main);

  // Your mechanism is ready now.. In this activity from anywhere if you get force close error it will be redirected to the CrashActivity.
}}
origin: stackoverflow.com

UncaughtExceptionHandler uncaughtExceptionHandler = new UncaughtExceptionHandler(){
         @Override
         public void uncaughtException(Thread thread,
             Throwable ex) {
           //Here print the log...
         }
       };
       Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler);
origin: stackoverflow.com

 Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
  @Override
  public void uncaughtException(Thread thread, Throwable ex) {
    // your code
  }
});
origin: stackoverflow.com

 Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
  public void uncaughtException(Thread thread, Throwable ex) {
    // log, or create some statistics ... whatever
  }
});
origin: stackoverflow.com

setContentView(R.layout.current);
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread t, Throwable e) {
   android.os.Process.killProcess(android.os.Process.myPid());
   System.exit(0);
}
code....
origin: stackoverflow.com

Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
   @Override
   public void uncaughtException(Thread thread, Throwable ex) {
     // TODO Auto-generated method stub
   }
 });
origin: stackoverflow.com

Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
     @Override
     public void uncaughtException(Thread t, Throwable e) {
       // TODO implement this
     }
   });
origin: stackoverflow.com

Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
   @Override
   public void uncaughtException(Thread thread, Throwable t) {
     //Do something
   }
 });
origin: stackoverflow.com

 public class MyApplication extends android.app.Application{

  @Override
  public void onCreate() {
    super.onCreate();

    Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {

      @Override
      public void uncaughtException(Thread arg0, Throwable arg1) {
        doSomething();
      }
    });
  }
}
origin: stackoverflow.com

 Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
  @Override
  public void uncaughtException(Thread t, Throwable e) {
    ...
  }
});
origin: stackoverflow.com

 @Override
public void onCreate ()
{
  Thread.setDefaultUncaughtExceptionHandler(
      new UncaughtExceptionHandler(){

        @Override
        public void uncaughtException(Thread arg0, Throwable arg1) {
          //mytoast here


        }

      }
  );
  super.onCreate();


}
com.nilhcem.fakesmtp.core.exceptionUncaughtExceptionHandler

Javadoc

Intercepts every uncaught exception.

Most used methods

  • <init>
  • setParentComponent
    Sets the parent component where an error dialog might be displayed.
  • showException
    Displays an error dialog describing the uncaught exception.
  • uncaughtException
    Called when an uncaught exception is thrown. Will display the error message in a dialog box.

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Notification (javax.management)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now