mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-25 10:37:51 +01:00
Removed DBOpException fatal field
This commit is contained in:
parent
11e0b6b9ed
commit
ac5095153e
@ -9,8 +9,6 @@ import java.sql.SQLException;
|
|||||||
*/
|
*/
|
||||||
public class DBOpException extends RuntimeException {
|
public class DBOpException extends RuntimeException {
|
||||||
|
|
||||||
private boolean fatal = false;
|
|
||||||
|
|
||||||
public DBOpException(String message) {
|
public DBOpException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
@ -23,11 +21,4 @@ public class DBOpException extends RuntimeException {
|
|||||||
return new DBOpException("SQL Failed: " + sql + "; " + e.getMessage(), e);
|
return new DBOpException("SQL Failed: " + sql + "; " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFatal() {
|
|
||||||
return fatal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFatal(boolean fatal) {
|
|
||||||
this.fatal = fatal;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -74,11 +74,7 @@ public class InspectCommand extends CommandNode {
|
|||||||
checkWebUserAndNotify(activeDB, sender);
|
checkWebUserAndNotify(activeDB, sender);
|
||||||
Processing.submit(new InspectCacheRequestProcessor(uuid, sender, playerName, locale));
|
Processing.submit(new InspectCacheRequestProcessor(uuid, sender, playerName, locale));
|
||||||
} catch (DBOpException e) {
|
} catch (DBOpException e) {
|
||||||
if (e.isFatal()) {
|
sender.sendMessage("§eDatabase exception occurred: " + e.getMessage());
|
||||||
sender.sendMessage("§cFatal database exception occurred: " + e.getMessage());
|
|
||||||
} else {
|
|
||||||
sender.sendMessage("§eNon-Fatal database exception occurred: " + e.getMessage());
|
|
||||||
}
|
|
||||||
Log.toLog(this.getClass(), e);
|
Log.toLog(this.getClass(), e);
|
||||||
} finally {
|
} finally {
|
||||||
this.cancel();
|
this.cancel();
|
||||||
|
@ -88,11 +88,7 @@ public class QInspectCommand extends CommandNode {
|
|||||||
|
|
||||||
sendMessages(sender, container);
|
sendMessages(sender, container);
|
||||||
} catch (DBOpException e) {
|
} catch (DBOpException e) {
|
||||||
if (e.isFatal()) {
|
sender.sendMessage("§eDatabase exception occurred: " + e.getMessage());
|
||||||
sender.sendMessage("§cFatal database exception occurred: " + e.getMessage());
|
|
||||||
} else {
|
|
||||||
sender.sendMessage("§eNon-Fatal database exception occurred: " + e.getMessage());
|
|
||||||
}
|
|
||||||
Log.toLog(this.getClass(), e);
|
Log.toLog(this.getClass(), e);
|
||||||
} finally {
|
} finally {
|
||||||
this.cancel();
|
this.cancel();
|
||||||
|
@ -58,9 +58,7 @@ public class UUIDUtility {
|
|||||||
try {
|
try {
|
||||||
uuid = db.fetch().getUuidOf(playerName);
|
uuid = db.fetch().getUuidOf(playerName);
|
||||||
} catch (DBOpException e) {
|
} catch (DBOpException e) {
|
||||||
if (e.isFatal()) {
|
Log.toLog(UUIDUtility.class, e);
|
||||||
Log.toLog(UUIDUtility.class, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user