[FIX] Logger.error

This commit is contained in:
Gravit 2021-06-20 10:42:13 +07:00
parent 7133727edd
commit 867f367860
No known key found for this signature in database
GPG key ID: 98A079490768CCE5
8 changed files with 15 additions and 16 deletions

View file

@ -344,7 +344,7 @@ public void run() {
try { try {
close(); close();
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error("LaunchServer close error", e);
} }
})); }));
CommonHelper.newThread("Command Thread", true, commandHandler).start(); CommonHelper.newThread("Command Thread", true, commandHandler).start();
@ -361,8 +361,7 @@ public void run() {
syncProfilesDir(); syncProfilesDir();
modulesManager.invokeEvent(new LaunchServerProfilesSyncEvent(this)); modulesManager.invokeEvent(new LaunchServerProfilesSyncEvent(this));
} catch (IOException e) { } catch (IOException e) {
logger.error(e); logger.error("Updates/Profiles not synced", e);
logger.error("Updates/Profiles not synced");
} }
}).start(); }).start();
} }
@ -373,7 +372,7 @@ public void run() {
modulesManager.invokeEvent(new LaunchServerFullInitEvent(this)); modulesManager.invokeEvent(new LaunchServerFullInitEvent(this));
logger.info("LaunchServer started"); logger.info("LaunchServer started");
} catch (Throwable e) { } catch (Throwable e) {
logger.error(e); logger.error("LaunchServer startup failed",e);
JVMHelper.RUNTIME.exit(-1); JVMHelper.RUNTIME.exit(-1);
} }
} }
@ -419,7 +418,7 @@ public void restart() {
try { try {
builder.start(); builder.start();
} catch (IOException e) { } catch (IOException e) {
logger.error(e); logger.error("Restart failed", e);
} }
} }

View file

@ -346,7 +346,7 @@ public void addPublicKeyToHardwareInfo(UserHardware hardware, byte[] publicKey)
s.setLong(2, mySQLUserHardware.id); s.setLong(2, mySQLUserHardware.id);
s.executeUpdate(); s.executeUpdate();
} catch (SQLException e) { } catch (SQLException e) {
logger.error(e); logger.error("SQL error", e);
} }
} }
@ -363,7 +363,7 @@ public Iterable<User> getUsersByHardwareInfo(UserHardware hardware) {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
logger.error(e); logger.error("SQL error", e);
return null; return null;
} }
return users; return users;
@ -379,7 +379,7 @@ public void banHardware(UserHardware hardware) {
s.setLong(2, mySQLUserHardware.id); s.setLong(2, mySQLUserHardware.id);
s.executeUpdate(); s.executeUpdate();
} catch (SQLException e) { } catch (SQLException e) {
logger.error(e); logger.error("SQL Error", e);
} }
} }
@ -393,7 +393,7 @@ public void unbanHardware(UserHardware hardware) {
s.setLong(2, mySQLUserHardware.id); s.setLong(2, mySQLUserHardware.id);
s.executeUpdate(); s.executeUpdate();
} catch (SQLException e) { } catch (SQLException e) {
logger.error(e); logger.error("SQL error", e);
} }
} }

View file

@ -77,7 +77,7 @@ public Path process(Path inputFile) throws IOException {
chain.add(certificate); chain.add(certificate);
signedDataGenerator = SignHelper.createSignedDataGenerator(server.keyAgreementManager.ecdsaPrivateKey, certificate, chain, "SHA256WITHECDSA"); signedDataGenerator = SignHelper.createSignedDataGenerator(server.keyAgreementManager.ecdsaPrivateKey, certificate, chain, "SHA256WITHECDSA");
} catch (OperatorCreationException | CMSException | CertificateException e) { } catch (OperatorCreationException | CMSException | CertificateException e) {
logger.error(e); logger.error("Certificate generate failed", e);
} }
return inputFile; return inputFile;
} }

View file

@ -89,7 +89,7 @@ protected void postInitProps() {
try { try {
return e.getEncoded(); return e.getEncoded();
} catch (CertificateEncodingException e2) { } catch (CertificateEncodingException e2) {
logger.error(e2); logger.error("Certificate encoding failed", e2);
return new byte[0]; return new byte[0];
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());

View file

@ -41,7 +41,7 @@ public static CMSSignedDataGenerator gen(LaunchServerConfig.JarSignerConf config
config.keyAlias, config.signAlgo, config.keyPass); config.keyAlias, config.signAlgo, config.keyPass);
} catch (CertificateEncodingException | UnrecoverableKeyException | KeyStoreException } catch (CertificateEncodingException | UnrecoverableKeyException | KeyStoreException
| OperatorCreationException | NoSuchAlgorithmException | CMSException e) { | OperatorCreationException | NoSuchAlgorithmException | CMSException e) {
logger.error(e); logger.error("Create signedDataGenerator failed", e);
return null; return null;
} }
} }

View file

@ -18,7 +18,7 @@ protected Thread newThread(Runnable r, String name) {
if (e.getMessage().contains("Connection reset by peer")) { if (e.getMessage().contains("Connection reset by peer")) {
return; return;
} }
logger.error(e); logger.error("Netty exception", e);
}); });
return thread; return thread;
} }

View file

@ -63,7 +63,7 @@ protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) {
try { try {
if (hooks.hook(ctx, frame)) return; if (hooks.hook(ctx, frame)) return;
} catch (Throwable ex) { } catch (Throwable ex) {
logger.error(ex); logger.error("WebSocket frame handler hook error", ex);
} }
if (frame instanceof TextWebSocketFrame) { if (frame instanceof TextWebSocketFrame) {
try { try {
@ -72,7 +72,7 @@ protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) {
logger.warn("Client {} send invalid request. Connection force closed.", context.ip == null ? IOHelper.getIP(ctx.channel().remoteAddress()) : context.ip); logger.warn("Client {} send invalid request. Connection force closed.", context.ip == null ? IOHelper.getIP(ctx.channel().remoteAddress()) : context.ip);
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace("Client message: {}", ((TextWebSocketFrame) frame).text()); logger.trace("Client message: {}", ((TextWebSocketFrame) frame).text());
logger.error(ex); logger.error("Process websockets request failed", ex);
} }
ctx.channel().close(); ctx.channel().close();
} }

View file

@ -49,7 +49,7 @@ public void execute(ChannelHandlerContext ctx, Client client) {
sendError(e.getMessage()); sendError(e.getMessage());
return; return;
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error("Join Server error", e);
sendError("Internal authHandler error"); sendError("Internal authHandler error");
return; return;
} }