Frontmatter
| id | 9444 |
| title | Clean up redundant `Neo.isDestroyed` catch blocks |
| state | Closed |
| labels | enhancementairefactoringcore |
| assignees | tobiu |
| createdAt | Mar 11, 2026, 5:42 PM |
| updatedAt | Mar 15, 2026, 12:39 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9444 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 11, 2026, 5:53 PM |
Clean up redundant Neo.isDestroyed catch blocks

tobiu
Mar 11, 2026, 5:52 PM
Input from Gemini 3.1 Pro:
✦ The redundant catch blocks checking for
Neo.isDestroyedhave been removed from the identified locations:
src/worker/mixin/RemoteMethodAccess.mjssrc/component/Circle.mjssrc/component/Helix.mjssrc/mixin/DomEvents.mjssrc/core/Base.mjs(Note: The explicit check in
src/component/MagicMoveText.mjswas intentionally left in place because it is not a redundant re-throw; it serves as a critical early exit (return;) before executing a visual retry fallback loop, which we do not want to trigger on a destroyed component).The codebase is now cleaner, relying on the central
unhandledrejectioninterceptors insrc/Neo.mjsto silently swallowNeo.isDestroyedexceptions as designed.
tobiu closed this issue on Mar 11, 2026, 5:53 PM
tobiu assigned to @tobiu on Mar 15, 2026, 12:39 PM
The framework globally handles unhandled promise rejections for the
Neo.isDestroyedsymbol (insidesrc/Neo.mjs).Because of this built-in global interceptor, individual
.catch()blocks on promises (like those returned bythis.trap()) that merely check forerr !== Neo.isDestroyedand re-throw are redundant and add unnecessary boilerplate to the codebase.We should clean up the remaining occurrences of this pattern in the
src/directory to simplify the code.Occurrences found in:
src/worker/mixin/RemoteMethodAccess.mjssrc/component/Circle.mjssrc/component/Helix.mjssrc/component/MagicMoveText.mjssrc/mixin/DomEvents.mjssrc/core/Base.mjs