Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[quarkus] Missing Error handler #1294

Closed
matzew opened this issue Sep 30, 2022 · 8 comments
Closed

[quarkus] Missing Error handler #1294

matzew opened this issue Sep 30, 2022 · 8 comments
Labels
kind/feature-request lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@matzew
Copy link
Member

matzew commented Sep 30, 2022

When an error/exception occurs, I sometimes want to decorate the actual HTTP response, returned by Quarkus.

Motivation for decorating the error is here.

Now, let's say I have a bogus app that creates a NPE, like:

@Funq
public CloudEvent<Output> function(CloudEvent<Input> input) {

    // Add your business logic here
    iAmNull.toString();

    ...
    ...

    return CloudEventBuilder.create().build(replayEvent);
}

this gives me this log, on the kn func run... console:

2022-09-30 08:01:23,905 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to / failed, error id: cc9491bf-4257-4762-a84e-89031ff05010-1: io.quarkus.funqy.runtime.ApplicationException: java.lang.NullPointerException
	at io.quarkus.funqy.runtime.FunctionInvoker.invoke(FunctionInvoker.java:134)
	at io.quarkus.funqy.runtime.bindings.knative.events.VertxRequestHandler.dispatch(VertxRequestHandler.java:567)
	at io.quarkus.funqy.runtime.bindings.knative.events.VertxRequestHandler.lambda$processCloudEvent$4(VertxRequestHandler.java:399)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:545)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
	at functions.Function.function(Function.java:27)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at io.quarkus.funqy.runtime.FunctionInvoker.invoke(FunctionInvoker.java:123)
	... 9 more

and the curl:

* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.79.1
> Accept: */*
> content-type: application/json
> ce-specversion: 1.0
> ce-source: curl-command
> ce-type: curl.demo
> ce-smartevent: super-duper-event-extension
> ce-id: 123-abc
> Content-Length: 25
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< content-type: application/json; charset=utf-8
< content-length: 72
< 
* Connection #0 to host localhost left intact
{"details":"Error id cc9491bf-4257-4762-a84e-89031ff05010-1","stack":""}%                

It would be nice if the documentation shows how to add an error-handler or the like

@lance
Copy link
Member

lance commented Oct 10, 2022

/kind enhancement

@lance lance moved this to ❄ Icebox in Functions WG Roadmap Oct 10, 2022
@lance lance added this to the 1.9.0 Release milestone Nov 15, 2022
@lance
Copy link
Member

lance commented Nov 15, 2022

/kind good-first-issue

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 14, 2023
@zroubalik
Copy link
Contributor

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 14, 2023
@lance lance modified the milestones: 1.9.0 Release, Release 1.10 Feb 14, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 16, 2023
@lance lance modified the milestones: Release 1.10, Release 1.11 May 16, 2023
@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 17, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 16, 2023
@lance
Copy link
Member

lance commented Aug 16, 2023

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 16, 2023
@lkingland lkingland added kind/good-first-issue Denotes an issue ready for a new contributor. kind/feature-request and removed good-first-issue kind/good-first-issue Denotes an issue ready for a new contributor. kind/enhancement labels Aug 17, 2023
@lkingland lkingland removed this from the Release 1.11 milestone Aug 23, 2023
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
@github-project-automation github-project-automation bot moved this from ❄ Icebox to ✅ Done in Functions WG Roadmap Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants