Skip to content

Conversation

@kellemar
Copy link

The OSD class has 4 methods that wrap calls to parent document methods in try-catch blocks. The catch blocks were empty, which looks like a bug or lazy error handling at first glance.

Turns out it's intentional - these methods can throw when the game runs inside a cross-origin iframe (the parent document's OSD methods aren't accessible due to same-origin policy). Silently failing is actually the right behavior here since the OSD indicators are optional UI chrome, not critical functionality.

Added comments to each catch block so the next person who looks at this doesn't waste time wondering if it's a bug.
Changes:

  • tslib/services/osdlib.ts - Added explanatory comments to all 4 empty catch blocks (startLoading, startSaving, stopLoading, stopSaving)

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