Commit 12c5b752 authored by Trisha Gee's avatar Trisha Gee
Browse files

[appA] Music server exception handling aligned with preferences for the book

parent 1097f89d
Loading
Loading
Loading
Loading
+0 −1
Changes for src/main/java/appA/BeatBoxFinal.java: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ public class BeatBoxFinal {
    userMessage.setLineWrap(true);
    userMessage.setWrapStyleWord(true);
    JScrollPane messageScroller = new JScrollPane(userMessage);

    buttonBox.add(messageScroller);

    incomingList = new JList<>();
+9 −9
Changes for src/main/java/appA/MusicServer.java: 9 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -24,10 +24,10 @@ public class MusicServer {

        ClientHandler clientHandler = new ClientHandler(clientSocket);
        threadPool.execute(clientHandler);
        System.out.println("got a connection");
        System.out.println("Got a connection");
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

@@ -36,8 +36,8 @@ public class MusicServer {
      try {
        clientOutputStream.writeObject(one);
        clientOutputStream.writeObject(two);
      } catch (Exception ex) {
        ex.printStackTrace();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
@@ -48,8 +48,8 @@ public class MusicServer {
    public ClientHandler(Socket socket) {
      try {
        in = new ObjectInputStream(socket.getInputStream());
      } catch (Exception ex) {
        ex.printStackTrace();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }

@@ -63,8 +63,8 @@ public class MusicServer {
          System.out.println("read two objects");
          tellEveryone(userName, beatSequence);
        }
      } catch (Exception ex) {
        ex.printStackTrace();
      } catch (IOException | ClassNotFoundException e) {
        e.printStackTrace();
      }
    }
  }