-
Notifications
You must be signed in to change notification settings - Fork 224
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
fix http result errors by wrapping the upstream error, allowing for isNack #764
fix http result errors by wrapping the upstream error, allowing for isNack #764
Conversation
Signed-off-by: Stephen Greene <stephen.greene@sap.com>
…sNack Signed-off-by: Scott Nichols <n3wscott@chainguard.dev>
@sbgreene1307 would you mind reviewing this? Thanks for your unit test and your issue!! |
a43e5cb
to
55e88fc
Compare
Signed-off-by: Scott Nichols <n3wscott@chainguard.dev>
55e88fc
to
b060ffb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple minor things to button up
@@ -113,6 +114,9 @@ func (t *tapHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |||
w.WriteHeader(500) | |||
return | |||
} | |||
if t.statusCode > 299 { | |||
w.WriteHeader(t.statusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to add a return here which I think is what is causing the "superfluous" log line that you see in the tests. Do you want to just add that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
@@ -83,6 +86,7 @@ func ClientDirect(t *testing.T, tc DirectTapTest, copts ...client.Option) { | |||
t.Errorf("expected ACK, got %s", result) | |||
} | |||
} else if !cloudevents.ResultIs(result, tc.wantResult) { | |||
t.Errorf("result.IsUndelivered = %v", cloudevents.IsUndelivered(result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed now as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the extra output
Signed-off-by: Scott Nichols <n3wscott@chainguard.dev>
ecbe51c
to
cfc6cef
Compare
…or before the handler Signed-off-by: Scott Nichols <n3wscott@chainguard.dev>
fixes: #762