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

JBIDE-21460 NPE at Show In Web Browser for OpenShift server if connection is not connected #912

Merged
merged 1 commit into from
Mar 1, 2016

Conversation

scabanovich
Copy link
Contributor

OpenShift core plugin has no ui to show dialog, so problem is reported with special exceptions
to be displayed by client ui plugin.

if(service == null) {
throw new GetWelcomePageURLException("Service is missing.");
}

IProject project = service.getProject();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific to your pull, but there is no need to get a project to get the routes. You can accomplish this same call using the connection and retrieving the required project information by service#getNamespace(). This additionally saves you a REST call to load the project resource, and you could remove the throw from the null project all together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestion. Done.

@scabanovich scabanovich force-pushed the jbide-21460 branch 3 times, most recently from f022ba7 to 531a422 Compare January 22, 2016 01:37
}
} catch (OpenShiftException e) {
ExpressCoreActivator.pluginLog().logError(expectedConnectionProblem, e);
throw new GetApplicationException(expectedConnectionProblem);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho we should not swallow the root OpenShiftException but pass it to the new exception

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done. Now, this catch does not log the error, it is to be logged or shown in a message dialog or rethrown where this method is called.

…tion is not connected

OpenShift core plugin has no ui to show dialog, so problem is reported with special exceptions
to be displayed by client ui plugin.
@adietish
Copy link
Member

adietish commented Mar 1, 2016

ok, cool: no NPE, a dialog that tells me that the connection is not established yet.

@adietish
Copy link
Member

adietish commented Mar 1, 2016

merging to jbosstools-4.3.x and master

@adietish adietish merged commit 40ce9fc into jbosstools:master Mar 1, 2016
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