Skip to content

Commit

Permalink
refactor: avoid dependency with httpcore
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-godoy committed Dec 12, 2023
1 parent 923ab8a commit 41fb24f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.vaadin.flow.router.ErrorParameter;
import com.vaadin.flow.router.HasErrorParameter;
import com.vaadin.flow.router.internal.DefaultErrorHandler;
import org.apache.http.HttpStatus;

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

private static final int INTERNAL_SERVER_ERROR = 500;

/**
* This method sets the error parameter to display the error message and returns an HTTP status
* code of 500 Internal Server Error.
Expand All @@ -57,7 +58,7 @@ public void close() {
}
}.getChildren().forEach(this::add);

return HttpStatus.SC_INTERNAL_SERVER_ERROR;
return INTERNAL_SERVER_ERROR;
}

}

0 comments on commit 41fb24f

Please sign in to comment.