Skip to content

Commit

Permalink
refactor: NotAllowedExtensionException 으로 예외 처리 세분화
Browse files Browse the repository at this point in the history
  • Loading branch information
jjongwa committed Sep 11, 2023
1 parent 304fe4d commit c5d20eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package nextstep.jwp.exception;

public class NotAllowedExtensionException extends RuntimeException {

public NotAllowedExtensionException() {
super("해당하는 Extension이 존재하지 않습니다.");
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.apache.coyote.http11;

import java.util.Arrays;
import nextstep.jwp.exception.NotAllowedMethodException;
import nextstep.jwp.exception.NotAllowedExtensionException;

public enum ExtensionType {

Expand All @@ -23,7 +23,7 @@ public static ExtensionType from(final String extension) {
return Arrays.stream(values())
.filter(it -> extension.contains(it.extension))
.findAny()
.orElseThrow(NotAllowedMethodException::new);
.orElseThrow(NotAllowedExtensionException::new);
}

public String getExtension() {
Expand Down

0 comments on commit c5d20eb

Please sign in to comment.