private <T> T exceptionHandlerNonCritical(T t, Throwable throwable) { if (throwable != null) { errorHandler.log(L.WARN, Processing.class, throwable.getCause()); } return t; }
private <T> T exceptionHandlerCritical(T t, Throwable throwable) { if (throwable != null) { errorHandler.log(L.ERROR, Processing.class, throwable.getCause()); } return t; }
@Override public void returnToPool(Connection connection) { try { if (connection != null) { connection.close(); } } catch (SQLException e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
@Override public void commit(Connection connection) { try { connection.commit(); } catch (SQLException e) { if (!e.getMessage().contains("cannot commit")) { errorHandler.log(L.ERROR, this.getClass(), e); } } }
@Override public void commit(Connection connection) { try { connection.commit(); } catch (SQLException e) { if (!e.getMessage().contains("cannot commit")) { errorHandler.log(L.ERROR, this.getClass(), e); } } }
public void reload() { try { config.read(); } catch (IOException e) { errorHandler.log(L.ERROR, this.getClass(), e); } } }
private void disableSystems(SubSystem... systems) { for (SubSystem system : systems) { try { if (system != null) { system.disable(); } } catch (Exception e) { errorHandler.log(L.WARN, this.getClass(), e); } } }
@Override public void disable() { try { if (db != null) { db.close(); } } catch (DBException e) { errorHandler.log(L.WARN, this.getClass(), e); } }
private void copyFromJar(String[] resources) { for (String resource : resources) { try { copyFromJar(resource); } catch (IOException e) { errorHandler.log(L.WARN, this.getClass(), e); } } }
public ErrorResponse internalErrorResponse(Throwable e, String s) { try { errorHandler.log(L.WARN, this.getClass(), e); return new InternalErrorResponse(s, e, versionCheckSystem, files); } catch (IOException improperRestartException) { return new ErrorResponse( "Error occurred: " + e.toString() + ", additional error occurred when attempting to send error page to user: " + improperRestartException.toString() ); } }
@Override public Map<UUID, String> getKnownPlayerNames() { try { return fetchFromPlanDB().getPlayerNames(); } catch (DBOpException e) { errorHandler.log(L.ERROR, this.getClass(), e); return new HashMap<>(); } }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerQuit(PlayerQuitEvent event) { try { actOnQuitEvent(event); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
@Override public void enable() { try { bridge.hook(this); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); logger.error("Plan Plugin Bridge not included in the plugin jar."); } }
@Override public void run() { try { if (isOpen()) { clean(); } } catch (DBOpException e) { errorHandler.log(L.ERROR, this.getClass(), e); cancel(); } } }).runTaskTimerAsynchronously(
@Listener(order = Order.POST) public void onLogin(ClientConnectionEvent.Login event) { try { actOnLoginEvent(event); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
@Listener(order = Order.POST) public void onJoin(ClientConnectionEvent.Join event) { try { actOnJoinEvent(event); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { try { actOnJoinEvent(event); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
private void event(TargetPlayerEvent event) { try { performedAction(event.getTargetEntity()); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
@EventHandler(priority = EventPriority.MONITOR) public void onWorldChange(PlayerChangedWorldEvent event) { try { actOnEvent(event); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }
@Listener(order = Order.POST) public void onQuit(ClientConnectionEvent.Disconnect event) { try { actOnQuitEvent(event); } catch (Exception e) { errorHandler.log(L.ERROR, this.getClass(), e); } }