Add ExceptionHandler
This commit is contained in:
parent
167ba12e50
commit
effb0abea9
25
src/com/annimon/turrets/util/ExceptionHandler.java
Normal file
25
src/com/annimon/turrets/util/ExceptionHandler.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.annimon.turrets.util;
|
||||
|
||||
import com.annimon.turrets.Constants;
|
||||
|
||||
/**
|
||||
* Handle exceptions.
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public class ExceptionHandler {
|
||||
|
||||
private static final boolean DEBUG_MODE = Constants.DEBUG_MODE;
|
||||
|
||||
public static void handle(Throwable throwable) {
|
||||
if (DEBUG_MODE) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void handle(Throwable throwable, String comment) {
|
||||
if (DEBUG_MODE) {
|
||||
System.out.println(comment);
|
||||
handle(throwable);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user