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.
fix quarkusio#5236
- Loading branch information
Showing
8 changed files
with
316 additions
and
116 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...ertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/FailureBuildItem.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,27 @@ | ||
package io.quarkus.vertx.http.deployment; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.vertx.core.Handler; | ||
import io.vertx.ext.web.RoutingContext; | ||
|
||
/** | ||
* A handler that is applied to every route | ||
*/ | ||
public final class FailureBuildItem extends MultiBuildItem { | ||
|
||
private final Handler<RoutingContext> handler; | ||
|
||
/** | ||
* Creates a new instance of {@link FailureBuildItem}. | ||
* | ||
* @param handler the handler, if {@code null} the filter won't be used. | ||
*/ | ||
public FailureBuildItem(Handler<RoutingContext> handler) { | ||
this.handler = handler; | ||
} | ||
|
||
public Handler<RoutingContext> getHandler() { | ||
return handler; | ||
} | ||
|
||
} |
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
112 changes: 0 additions & 112 deletions
112
...s/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/QuarkusErrorHandler.java
This file was deleted.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
...s/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/error/ErrorRecorder.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,20 @@ | ||
package io.quarkus.vertx.http.runtime.error; | ||
|
||
import io.quarkus.runtime.LaunchMode; | ||
import io.quarkus.runtime.annotations.Recorder; | ||
import io.quarkus.vertx.http.runtime.HttpConfiguration; | ||
import io.vertx.core.Handler; | ||
import io.vertx.ext.web.RoutingContext; | ||
|
||
@Recorder | ||
public class ErrorRecorder { | ||
|
||
public Handler<RoutingContext> errorHandler(HttpConfiguration configuration, LaunchMode launchMode) { | ||
if (configuration.failure.handler.isPresent()) { | ||
//todo manage handler from config | ||
return null; | ||
} else { | ||
return new QuarkusErrorHandler(launchMode.isDevOrTest()); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...s/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/error/FailureConfig.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,23 @@ | ||
package io.quarkus.vertx.http.runtime.error; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class FailureConfig { | ||
|
||
/** | ||
* Failure handler | ||
*/ | ||
@ConfigItem | ||
public Optional<String> handler; | ||
|
||
@Override | ||
public String toString() { | ||
return "FailureConfig{" + | ||
"handler=" + handler + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.