Small fixes

This commit is contained in:
Christopher Schnick
2022-10-20 09:11:45 +02:00
parent d6cccd1d5a
commit aa07f88e1d
9 changed files with 80 additions and 34 deletions

View File

@@ -171,15 +171,15 @@ public abstract class BeaconConnection implements AutoCloseable {
private BeaconException unwrapException(Exception exception) {
if (exception instanceof ServerException s) {
return new BeaconException("An internal server error occurred", s.getCause());
return new BeaconException("An internal server error occurred", s);
}
if (exception instanceof ClientException s) {
return new BeaconException("A client error occurred", s.getCause());
return new BeaconException("A client error occurred", s);
}
if (exception instanceof ConnectorException s) {
return new BeaconException("A beacon connection error occurred", s.getCause());
return new BeaconException("A beacon connection error occurred", s);
}
return new BeaconException("An unexpected error occurred", exception);

View File

@@ -63,7 +63,7 @@ public class BeaconServer {
System.out.println("Starting daemon: " + command);
}
new Thread(
var out = new Thread(
null,
() -> {
try {
@@ -79,10 +79,11 @@ public class BeaconServer {
ioe.printStackTrace();
}
},
"daemon sysout")
.start();
"daemon sysout");
out.setDaemon(true);
out.start();
new Thread(
var err = new Thread(
null,
() -> {
try {
@@ -98,8 +99,9 @@ public class BeaconServer {
ioe.printStackTrace();
}
},
"daemon syserr")
.start();
"daemon syserr");
err.setDaemon(true);
err.start();
}
public static boolean tryStop(BeaconClient client) throws Exception {

View File

@@ -11,7 +11,7 @@ import lombok.NonNull;
import lombok.Value;
import lombok.extern.jackson.Jacksonized;
import java.util.Map;
import java.util.LinkedHashMap;
/**
* Queries general information about a data source.
@@ -50,7 +50,7 @@ public class QueryDataSourceExchange implements MessageExchange {
String provider;
@NonNull
Map<String, String> config;
LinkedHashMap<String, String> config;
DataSource<?> internalSource;
}