Skip to content

Instantly share code, notes, and snippets.

@horatiu-udrea
Created May 25, 2018 12:22
Show Gist options
  • Save horatiu-udrea/c80226f5f1baa1b629662b41c4e26bd3 to your computer and use it in GitHub Desktop.
Save horatiu-udrea/c80226f5f1baa1b629662b41c4e26bd3 to your computer and use it in GitHub Desktop.
Pro exception handler ;)
import java.awt.Desktop;
import java.net.URI;
public final class ExceptionHandler
{
private ExceptionHandler(){}
public static void handle(Exception e)
{
try
{
if (Desktop.isDesktopSupported())
{
Desktop.getDesktop()
.browse(new URI("https://stackoverflow.com/search?q=[java]" + e.getMessage()));
}
}
catch (Exception ignored)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment