-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CHE-5505: Fix NPE in DockerConnector #5510
Conversation
Signed-off-by: Mykola Morhun <[email protected]>
return GSON.fromJson(reader, clazz); | ||
T objectFromJson = GSON.fromJson(reader, clazz); | ||
if (objectFromJson == null) { | ||
throw new IOException("Docker responded with an empty stream."); |
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.
Empty stream says nothing to a user I suppose. And in certain cases, e.g. 301 or 201, an empty body is OK, so this message can be frustrating a bit.
WDYT about next code instead:
LOG.error("Docker response doesn't contain any data, though it was expected to contain some. Stack trace: {}", Thread.currentThread().getStackTrace());
throw new IOException("Internal server error. Unexpected response body from Docker daemon received.");
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.
Agree, this will be better.
Signed-off-by: Mykola Morhun <[email protected]>
Build # 2965 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2965/ to view the results. |
@mmorhun : Please assign milestone and label when merging. |
What does this PR do?
Fixes NPE in
DockerConnector
when Docker respond with 200 response code and empty stream.What issues does this PR fix or reference?
#5505
Changelog
Fixed NPE when docker responds with 200 response code and empty stream.
Release Notes
N/A
Docs PR
N/A