fix: handle donate link error gracefully on headless systems#782
Open
daresTheDevil wants to merge 1 commit into
Open
fix: handle donate link error gracefully on headless systems#782daresTheDevil wants to merge 1 commit into
daresTheDevil wants to merge 1 commit into
Conversation
clicking the donate link on a headless server (or anything without xdg-open/open) crashes lazydocker because the error from OpenLink bubbles up unhandled. now it shows an error panel instead, same pattern openFile already uses three lines below. tested by swapping OpenLinkCommand to xdg-open on macOS — error panel renders cleanly instead of crashing. fixes jesseduffield#437
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what's broken
clicking the donate link on a headless server crashes lazydocker. the system doesn't have
xdg-openinstalled,OpenLinkreturns an error, and it bubbles up unhandled to gocui's event loop which treats it as fatal. been open for 3 years.the fix
catch the error and show it in an error panel instead of crashing. this is the same pattern
openFilealready uses literally three lines belowhandleDonatein the same file, it was just missed here.tested
simulated a headless environment by swapping
OpenLinkCommandtoxdg-openon macOS (where it doesn't exist). before the fix: crash. after: error panel renders cleanly withexec: "xdg-open": executable file not found in $PATH.fixes #437