🐛 Improve launcher error handling across dialog platforms - #633
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4de163789d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Native picker calls inherited the legacy Windows dialog failure policy, so expected HRESULT failures leaked as IllegalStateException. Select the picker operational policy and wrap only its internal failure as FileKitPickerException, with retained native coverage for cancellation and exclusions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e956f16cf1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 099c7d8293
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d32980e4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 398ee62430
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b198eb65f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7367b44c5f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f0b3aa448
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ): PickerLaunchResult = try { | ||
| launch() | ||
| PickerLaunchResult.Launched | ||
| } catch (failure: ActivityNotFoundException) { |
There was a problem hiding this comment.
Route Android security rejections through onError
On managed or vendor-customized Android devices where an intent handler exists but platform policy rejects its launch, ActivityResultLauncher.launch can throw SecurityException rather than ActivityNotFoundException. This helper lets that exception escape the launcher synchronously, bypassing the new onError callback and leaving the pending picker metadata set; the analogous directory and saver launch helpers have the same gap. Normalize this operational rejection as the appropriate FileKit exception, as the camera launcher already does.
AGENTS.md reference: AGENTS.md:L30-L32
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39431d0b53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continuation.invokeOnCancellation { dialog.dispose() } | ||
| continuation.invokeOnCancellation { dialog.dispose() } | ||
| } | ||
| } catch (failure: HeadlessException) { |
There was a problem hiding this comment.
Normalize AWT display connection failures
When LinuxFilePicker selects the AWT fallback because XDG is unavailable and the JVM is not marked headless but cannot connect to the configured display server, initializing or showing FileDialog can throw java.awt.AWTError rather than HeadlessException. This catch misses that environmental failure, so the new Compose launcher propagates it instead of invoking onError with FileKitPickerException; normalize this AWT display failure alongside the headless case.
AGENTS.md reference: AGENTS.md:L30-L32
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abb11bb597
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| operation: suspend () -> T, | ||
| ): T = try { | ||
| operation() | ||
| } catch (failure: HeadlessException) { |
There was a problem hiding this comment.
Catch Swing display connection failures
When XDG is unavailable, LinuxFilePicker routes directory selection through this Swing path; on a JVM that is not marked headless but cannot connect to the configured X11/Wayland display, constructing or showing JFileChooser can throw AWTError. This wrapper catches only HeadlessException, so the raw error bypasses the new FileKitDialogException/Compose onError contract. Catch and normalize AWTError here as the AWT picker and saver paths already do.
Useful? React with 👍 / 👎.
Summary
Testing