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

Workspace Templates: show error when fetching templates from Github #6440

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chrisrueger
Copy link
Contributor

@chrisrueger chrisrueger commented Jan 23, 2025

In this PR

This PR is about error handling the following two wizards:

image

This shows an ErrorDialog the UI when there are problems fetching from Github. The error message also includes a hint to https://bnd.bndtools.org/instructions/connection-settings.html because sometimes you have a ~/.m2/settings.xml with some credentials which can lead to "Bad Credentials" http errors from the Github API, but before this fix you had no idea what was going on, because the UI was blank and the existance of ~/.m2/settings.xml is easily forgotten

The message reads (wording improvements welcome):

Failed to load from template loader (Load workspace templates from GitHub repositories) See Error Log for stack trace:
java.io.IOException: Error (HTTP 520) - no response: TaggedData [tag=, code=520, modified=Thu Jan 01 00:59:59 CET
1970, url=https://api.github.com/repos/bndtools/bndtools.workspace.min, state=OTHER] (Check https://bnd.bndtools.org/instructions/connection-settings.html in case of connection or authentication errors.)

image

Eclipse Error Log tab:

image

At least now you see that something is wrong and also get some information.
Before this it was completely unknown, since the list of templates just appeared empty.

Last but not least, I added the same ErrorDialog also to the (new) Template Fragment Wizard... which can suffer from the same HTTP connection problems. Now the user sees an error dialog too and knows what's going on

This shows "some" error in the UI when there are problems fetching from Github.
The error message also includes a hint to https://bnd.bndtools.org/instructions/connection-settings.html because sometimes you have a ~/.m2/settings.xml with some credentials which can lead to "Bad Credentials" http errors from the Github API, but before this fix you had no idea what was going on, because the UI was blank and the existance of ~/.m2/settings.xml is easily forgotton

Signed-off-by: Christoph Rueger <[email protected]>
@chrisrueger
Copy link
Contributor Author

@peterkir could you have a look and see what the output is in your error case with the incorrect credentials in ~/.m2/settings.xml

instead of abusing the description field.
this seems better suited to display information about an exception.

Signed-off-by: Christoph Rueger <[email protected]>
@chrisrueger
Copy link
Contributor Author

chrisrueger commented Jan 26, 2025

Build error seems to be because of a http error e.g. when accessing stuff from https://download.eclipse.org/ they seem to have maintanance https://www.eclipsestatus.io/

I will retry later

@chrisrueger chrisrueger changed the title show error when fetching templates from Github Workspace Templates: show error when fetching templates from Github Jan 26, 2025
I noticed it does not used in the final display of the ErrorDialog.

Signed-off-by: Christoph Rueger <[email protected]>
since the same http errors can happen there too, so the user should notice that with info whats going wrong

Signed-off-by: Christoph Rueger <[email protected]>
@chrisrueger chrisrueger requested a review from peterkir January 26, 2025 20:07
@chrisrueger chrisrueger self-assigned this Jan 26, 2025
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.

1 participant