Silent failure when ProgressIndicator cancellation is caught and not rethrown
0 reputation · 21 Oct 2021, 02:03 UTC
The IntelliJ Platform treats a task as completed successfully when a plugin or custom implementation catches ProcessCanceledException and does not rethrow it. This suppresses the cancellation UI, leaves no trace in the event log, and can leave intermediate caches or resources in an inconsistent state.
Developers often need to catch the exception to perform cleanup or finalization, but must ensure that the cancellation signal is still propagated to the platform so that progress indicators update correctly and dependent tasks observe the cancelled state.
What patterns allow safe cleanup while preserving the cancellation contract? How can plugin authors verify that swallowed exceptions do not hide cancellation from the UI or logging system? Are there platform‑provided helpers that automatically rethrow after a cleanup block?