Skip to content

Commit 83b2c16

Browse files
committed
Remove Runtime Error
1 parent 044df43 commit 83b2c16

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/main/java/httpserver/Logger.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ public void log(String logString) {
3030
private void createFileIfDoesntExist(Path path) {
3131
try {
3232
fileOperator.createFileAtPath(path);
33-
} catch (IOException e) {
34-
throw new RuntimeException(e);
35-
}
33+
} catch (IOException e) { }
3634
}
3735

3836
public byte[] readLog() throws IOException {

src/test/java/httpserver/LoggerTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,4 @@ public void printsErrorToStdErrIfCantWriteToLog() throws Exception {
5959

6060
verify(printStreamMock).print(any(Exception.class));
6161
}
62-
63-
@Test(expected = RuntimeException.class)
64-
public void throwsRuntimeExceptionIfCantCreateLogFile() throws Exception {
65-
doThrow(new IOException()).when(fileOperatorMock).createFileAtPath(any());
66-
67-
Logger logger = new Logger(logPath, fileOperatorMock, printStreamMock);
68-
}
6962
}

0 commit comments

Comments
 (0)