Fix SWCommand with 0 args, Add SWException option to get ID
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
Dieser Commit ist enthalten in:
Ursprung
e76473e0be
Commit
1237a699ba
@ -102,7 +102,7 @@ public abstract class AbstractSWCommand<T> {
|
|||||||
|
|
||||||
protected final List<String> tabComplete(T sender, String alias, String[] args) throws IllegalArgumentException {
|
protected final List<String> tabComplete(T sender, String alias, String[] args) throws IllegalArgumentException {
|
||||||
initialize();
|
initialize();
|
||||||
String string = args.length > 0 ? args[args.length - 1].toLowerCase() : "";
|
String string = args[args.length - 1].toLowerCase();
|
||||||
return Stream.concat(commandList.stream(), helpCommandList.stream())
|
return Stream.concat(commandList.stream(), helpCommandList.stream())
|
||||||
.filter(s -> !s.noTabComplete)
|
.filter(s -> !s.noTabComplete)
|
||||||
.map(s -> s.tabComplete(sender, args))
|
.map(s -> s.tabComplete(sender, args))
|
||||||
|
@ -52,10 +52,17 @@ public class SWException {
|
|||||||
private final String stacktrace;
|
private final String stacktrace;
|
||||||
|
|
||||||
public static void log(String message, String stacktrace){
|
public static void log(String message, String stacktrace){
|
||||||
|
insert.update(SERVER_NAME, generateMessage(message), stacktrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int logGetId(String message, String stacktrace) {
|
||||||
|
return insert.insertGetKey(SERVER_NAME, generateMessage(message), stacktrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String generateMessage(String message) {
|
||||||
StringBuilder msgBuilder = new StringBuilder(message);
|
StringBuilder msgBuilder = new StringBuilder(message);
|
||||||
SQLWrapper.impl.additionalExceptionMetadata(msgBuilder);
|
SQLWrapper.impl.additionalExceptionMetadata(msgBuilder);
|
||||||
msgBuilder.append("\nCWD: ").append(CWD);
|
msgBuilder.append("\nCWD: ").append(CWD);
|
||||||
|
return msgBuilder.toString();
|
||||||
insert.update(SERVER_NAME, msgBuilder.toString(), stacktrace);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren