meghrathod / chatX

Overly generic exceptions should not be thrown JAVA-W1042
Anti-pattern
Major
2 years ago2 years old
main should throw an exception more specific than Exception
10    public static ArrayList<PrintWriter> noslist = new ArrayList<>();
11    public static ArrayList<User> Userdb = new ArrayList<User>();
12
13    public static void main(String[] args) throws Exception {14        System.out.println("Server signing On");
15        ServerSocket ss = new ServerSocket(9085);
16        MessageDispatcher md = new MessageDispatcher();
main should throw an exception more specific than Exception
 5import java.net.*;
 6
 7public class Client {
 8    public static void main(String[] args) throws Exception { 9        System.out.println("Client Signing on");
10        try {
11            Socket soc = new Socket("127.0.0.1", 9085);