-
Notifications
You must be signed in to change notification settings - Fork 1
에러 코드 정의 | 4
jeongmin edited this page Feb 2, 2024
·
1 revision
-
4000: read 시스템 콜 실패
예외 클래스 runtime_error 예외 메시지 [4000] Connection: readSocket - read fail 발생 원인 read 시스템 콜을 실패한 경우 예시 ssize_t bytesRead = read(_fd, buffer, sizeof(buffer) - 1); → -1 설명 클라이언트 소켓에서 요청 읽기를 시도하는 중 read 시스템콜이 실패한 경우 발생 -
4001: 응답 전송 중 write 시스템 콜 실패
예외 클래스 runtime_error 예외 메시지 [4001] Connection: send - fail to write socket 발생 원인 write 시스템 콜을 실패한 경우 예시 ssize_t bytesSent = write(_fd, response, strlen(response)); → -1 설명 클라이언트 소켓에 응답 쓰기를 시도하는 중 write 시스템콜이 실패한 경우 발생 -
4002: 에러 응답 전송 중 write 시스템 콜 실패
예외 클래스 runtime_error 예외 메시지 [4002] Connection: sendErrorPage - fail to write socket 발생 원인 write 시스템 콜을 실패한 경우 예시 ssize_t bytesSent = write(_fd, response.c_str(), response.length()); → -1 설명 클라이언트 소켓에 에러 응답 쓰기를 시도하는 중 write 시스템콜이 실패한 경우 발생 -
4003: 읽으려는 파일이 존재하지 않는 경우
예외 클래스 StatusException - HTTP_NOT_FOUND 예외 메시지 [4003] Connection: selectResponseBuilder - can't find file: {filePath} 발생 원인 읽으려는 파일이 존재하지 않는 경우 예시 access(filePath.c_str(), F_OK) == -1 설명 -
4004: Builder 선택 중 stat 시스템콜 호출에 실패한 경우
예외 클래스 runtime_error 예외 메시지 [4004] BuilderSelector: isDirRedirectSelected - stat failed: {filePath} 발생 원인 stat 시스템콜 호출에 실패한 경우 예시 설명 파일의 정보를 확인하기 위한 stat 시스템콜 호출이 실패한 경우 발생 -
4005: 허용하지 않는 메서드일 경우
예외 클래스 StatusException - HTTP_NOT_ALLOWED 예외 메시지 (405) [4005] Connection: selectResponseBuilder - method not allowed 발생 원인 허용하지 않는 메서드일 경우 예시 설명 config 파일에서 location 블럭 내 허용하는 메서드에 포함되지 않는 요청일 경우 예외 발생
-
4100: 중복된 커넥션 추가
예외 클래스 runtime_error 예외 메시지 [4100] ServerManager: addConnection - duplicate connection fd 발생 원인 ServerManager가 이미 관리하고 있는 fd를 추가로 추가 요청한 경우 예시 addConnection(fd); addConnection(fd); 설명 _connections에 이미 들어있는 fd 값을 인자로 전달한 경우 발생 -
4101: 관리 목록에 없는 fd 제거
예외 클래스 runtime_error 예외 메시지 [4101] ServerManager: removeConnection - no such connection fd 발생 원인 ServerManager가 관리하고 있지 않은 fd를 삭제 요청한 경우 예시 addConnection(4); removeConnection(5); 설명 _connections에 들어있지 않은 fd 값을 인자로 전달한 경우 발생 -
4102: 처리할 수 없는 event fd가 들어옴
예외 클래스 runtime_error 예외 메시지 [4102] ServerManager: handleEvent - unknown event fd 발생 원인 ServerManager에게 처리할 수 없는 이벤트 fd가 들어온 경우 예시 addConnection(4); handleConnection(event); // event.fd = 5 설명 server fd, client fd가 모두 아닌 값의 fd가 들어온 경우 발생 -
4103: 처리할 수 없는 event type이 들어옴
예외 클래스 runtime_error 예외 메시지 [4103] ServerManager: handleEvent - unknown event type 발생 원인 ServerManager에게 처리할 수 없는 이벤트 type이 들어온 경우 예시 addConnection(4); handleConnection(event); // event.type = unknown 설명 READ, WRITE type이 아닌 이벤트가 들어온 경우 발생
-
4200: 예상치 못한 event fd가 반환됨
예외 클래스 runtime_error 예외 메시지 [4200] EventLoop: run - unexpected event fd 발생 원인 Kqueue에서 처리할 수 없는 이벤트가 반환된 경우 예시 addConnection(fd); addConnection(fd); 설명 EventLoop의 ServerManager들이 모두 가지고 있지 않은 값의 fd가 반환된 경우 발생
- 허용 함수 정리
- 소켓 프로그래밍
- CGI
- 가상 호스트
- NGINX autoindex 동작 정리
- HTTP Request 파싱
- HTTP Request 값 유효성 검사
- Config 파일 Parsing