Skip to content

Commit 18cf41d

Browse files
javier-godoypaodb
authored andcommitted
refactor: avoid dependency with httpcore
1 parent 54af61a commit 18cf41d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.vaadin.flow.router.ErrorParameter;
2626
import com.vaadin.flow.router.HasErrorParameter;
2727
import com.vaadin.flow.router.internal.DefaultErrorHandler;
28-
import org.apache.http.HttpStatus;
2928

3029
/** View used to display an error message when navigation fails due to an exception. */
3130
@SuppressWarnings("serial")
@@ -34,6 +33,8 @@
3433
@jakarta.annotation.security.PermitAll
3534
public class ErrorView extends VerticalLayout implements HasErrorParameter<Exception> {
3635

36+
private static final int INTERNAL_SERVER_ERROR = 500;
37+
3738
/**
3839
* This method sets the error parameter to display the error message and returns an HTTP status
3940
* code of 500 Internal Server Error.
@@ -57,7 +58,7 @@ public void close() {
5758
}
5859
}.getChildren().forEach(this::add);
5960

60-
return HttpStatus.SC_INTERNAL_SERVER_ERROR;
61+
return INTERNAL_SERVER_ERROR;
6162
}
6263

6364
}

0 commit comments

Comments
 (0)