Skip to content

Commit

Permalink
Add HTTP_RESPONSE_STATUS_CODES to ResponseCode.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Kourosh Talebzadeh authored and Kourosh Talebzadeh committed Feb 8, 2024
1 parent 415b066 commit 06a6375
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/fungover/storm/client/ClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.fungover.storm.filehandler.re.FileInfo;
import org.fungover.storm.filehandler.re.FileNotFoundException;
import org.fungover.storm.filehandler.re.FileRequestHandler;
import org.fungover.storm.filehandler.re.ResponseCode;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down Expand Up @@ -43,7 +44,7 @@ public void run() {
clientSocket.close();
} catch (IOException e) {
if (e.getMessage().contains("500"))
LOGGER.error("500 Internal Server Error\r\n");
LOGGER.error(ResponseCode.HTTP_RESPONSE_STATUS_CODES);
else
LOGGER.error(e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ public enum ResponseCode {
FORBIDDEN("403 Forbidden"),
TEAPOT("418 I´m a teapot"),
INTERNAL_SERVER_ERROR("500 Internal Server Error"),
HTTP_RESPONSE_STATUS_CODES("500 Internal Server Error\r\n"),
NOT_IMPLEMENTED("501 Not Implemented");


private final String code;

ResponseCode(String code) {
Expand Down

0 comments on commit 06a6375

Please sign in to comment.