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

Print actual error when trying to access registry #1200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

herbae
Copy link

@herbae herbae commented Sep 10, 2019

I spent three whole days trying to figure out what was wrong with my configs in a controlled environment. The problem was a simple \n character in my schema registry credentials. It would have helped a lot if I could see the HTML response from schema registry server, instead of a JSON deserializing exception.

This patch does not solve the issue described in #733, but at least prints the actual error in the stack trace. JsonDeserializer will print the source string when it's not an InputStream.

This patch does not solve the issue described in confluentinc#733, but at least prints the actual error in the stack trace. JsonDeserializer will print the source string when it's not an InputStream.
@ghost
Copy link

ghost commented Sep 10, 2019

It looks like @herbae hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot

@herbae
Copy link
Author

herbae commented Sep 11, 2019 via email

@ghost
Copy link

ghost commented Sep 11, 2019

@confluentinc It looks like @herbae just signed our Contributor License Agreement. 👍

Always at your service,

clabot

@OneCricketeer
Copy link
Contributor

OneCricketeer commented Jan 28, 2020

Is the error returned to the client, or output to the server logs?

Is there any way to get it without a Scanner?

@joelezellLP
Copy link

Is anything going to happen with this MR? I just wasted days trying to diagnose a schema registry error which turned out to be a 504 gateway timeout. I'm not sure I agree with the implementation here by the way. I think the logic should be that if you get any 4xx/5xx response, you don't try to parse it as JSON. Just print the error code and raw message body.

@OneCricketeer
Copy link
Contributor

The logic here seems to be processing the whole InputStream to a string via a Scanner, before actually rendering the log, but yes, using not ObjectMapper for that case, or using a Scanner instead of new String(es.readAllBytes()), would look better, IMO

@cla-assistant
Copy link

cla-assistant bot commented Sep 25, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants