forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This exception is used to record the actual ports that cause binding conflicts, thus allowing Quarkus to properly inform the user of which port(s) caused conflicts instead of guessing based on what the provided configuration. Fixes: quarkusio#22967
- Loading branch information
Showing
4 changed files
with
100 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
core/runtime/src/main/java/io/quarkus/runtime/QuarkusBindException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkus.runtime; | ||
|
||
import java.net.BindException; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* An exception that is meant to stand in for {@link BindException} and provide information | ||
* about the target which caused the bind exception. | ||
*/ | ||
public class QuarkusBindException extends BindException { | ||
|
||
private final List<Integer> ports; | ||
|
||
public QuarkusBindException(int port) { | ||
this(Collections.singletonList(port)); | ||
} | ||
|
||
public QuarkusBindException(List<Integer> ports) { | ||
if (ports.isEmpty()) { | ||
throw new IllegalStateException("ports must not be empty"); | ||
} | ||
this.ports = ports; | ||
} | ||
|
||
public List<Integer> getPorts() { | ||
return ports; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters