better client error messages
This commit is contained in:
parent
f63fe57b98
commit
bfd5d40013
3 changed files with 17 additions and 12 deletions
|
|
@ -17,6 +17,7 @@ import io.netty.handler.ssl.SslContext;
|
|||
import io.netty.handler.ssl.SslContextBuilder;
|
||||
import io.netty.handler.ssl.SslProvider;
|
||||
import javax.net.ssl.SSLException;
|
||||
import java.util.InputMismatchException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Logger;
|
||||
|
|
@ -104,17 +105,21 @@ public class JobServServer {
|
|||
* calls server main loop.
|
||||
*/
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
int port = 8448; // TODO: port and key/cert files should be handled by a config manager
|
||||
|
||||
if(args.length < 3) {
|
||||
System.out.println("Usage: ./jobserv-server cert privatekey truststore");
|
||||
// TODO: port and key/cert files should be handled by a config manager
|
||||
if(args.length < 4) {
|
||||
System.out.println("Usage: ./jobserv-server port cert privatekey truststore");
|
||||
return;
|
||||
}
|
||||
|
||||
JobServServer server;
|
||||
|
||||
try{
|
||||
server = new JobServServer(8448, args[0], args[1], args[2]);
|
||||
try {
|
||||
server = new JobServServer(Integer.parseInt(args[0]), args[1], args[2], args[3]);
|
||||
|
||||
} catch (InputMismatchException e) {
|
||||
System.out.println("Invalid port!");
|
||||
return;
|
||||
|
||||
} catch (SSLException e) {
|
||||
System.out.println(e.getMessage());
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue