Skip to content

Show an error when the dialog to open a course fails - #80

Merged
Tsyklop merged 1 commit into
mainfrom
bug/show-open-in-ide-failures
Nov 30, 2026
Merged

Tsyklop merged 1 commit into
mainfrom
bug/show-open-in-ide-failures

Conversation

@Tsyklop

@Tsyklop Tsyklop commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

A tester on GoLand 2026.3.0.1 with plugin 2026.22 reported that opening a Hyperskill Go project from the browser showed the course loading progress, and then nothing happened. No project settings dialog and no error appeared.

Cause

The root cause in their log is a NoClassDefFoundError for com/goide/sdk/combobox/GoSdkChooserCombo, thrown while JoinCourseDialog was being built. That is EDU-9241, fixed separately in #78.

The reason it was silent is in ProjectOpener.openInNewProject. The dialog is created inside invokeAndWait. When building it throws, the exception escapes ProjectOpener.open, and the platform RestService only logs it as SEVERE. HyperskillRestService.openInIDE never reaches its Err branch, which is what shows a notification to the user. So any crash in this path leaves the user with nothing.

Fix

  • ProjectOpener: calls newProject(course) through showNewProjectDialog. An unexpected exception is logged with LOG.error, so the IDE error indicator with "Plugin to blame" still appears. It is then returned as Err(ValidationErrorMessage(...)). ControlFlowException and CancellationException are still rethrown.
  • Callers: the existing callers already handle that Err. The REST service shows a notification, for example: Failed to open the "Coffee Machine (Go)" course. See the IDE log for details. The browser gets the same 404 as for other opening errors. HyperskillProjectAction shows the error through its callback, and the next-activity flow logs it.
  • EduCoreBundle: new key error.failed.to.open.course, in English only, like most keys.

Successful openings and the existing validation errors behave as before.

Testing

  • New test: in HyperskillProjectOpenStageTest, MockProjectOpener.newProjectFailure makes newProject throw a NoClassDefFoundError. The test checks that the error is logged and that open returns the expected ValidationErrorMessage.
  • Test run: ./gradlew :intellij-plugin:test --tests "org.hyperskill.academy.learning.stepik.hyperskill.projectOpen.*" --tests "org.hyperskill.academy.learning.stepik.hyperskill.HyperskillNextActivityTest" on 263: 22 tests, all passed.
  • Other platforms: not run locally. The test uses LoggedErrorProcessor.executeAndReturnLoggedError(Runnable); javap confirms it exists in the 252 and 263 test frameworks.

When a course is opened from the browser in a new project, ProjectOpener
creates JoinCourseDialog inside invokeAndWait. If building the dialog
threw, the exception escaped ProjectOpener.open, and the platform
RestService only logged it. The caller's error branch never ran, so the
user saw the course loading progress and then nothing.

A GoLand 2026.3 tester hit this with a NoClassDefFoundError for
GoSdkChooserCombo (EDU-9241, fixed separately in #78).

ProjectOpener now catches unexpected failures of newProject, logs them
as errors and returns a ValidationErrorMessage. The existing callers
show it as a notification. Control-flow and cancellation exceptions are
still rethrown.
@Tsyklop
Tsyklop merged commit d5fa878 into main Nov 30, 2026
1 of 2 checks passed
@Tsyklop
Tsyklop deleted the bug/show-open-in-ide-failures branch November 30, 2026 13:10
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