Catch Errors reading resolved executable#2612
Merged
Conversation
In some internal platform implementation the `resolvedExecutable` is unexpectedly `null` and causes a `TypeError`. Generalize the catch to ignore all errors, not just exceptions.
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with |
brianquinlan
approved these changes
Mar 19, 2026
pkgs/test/CHANGELOG.md
Outdated
| ## 1.31.1-wip | ||
|
|
||
| * Ignore an error locating the SDK directory on platforms where the | ||
| `resolvedExecutable` is unexpectedly null. |
Contributor
There was a problem hiding this comment.
Suggested change
| `resolvedExecutable` is unexpectedly null. | |
| `resolvedExecutable` is unexpectedly `null`. |
pkgs/test_core/CHANGELOG.md
Outdated
| ## 0.6.18-wip | ||
|
|
||
| * Ignore an error locating the SDK directory on platforms where the | ||
| `resolvedExecutable` is unexpectedly null. |
Contributor
There was a problem hiding this comment.
Suggested change
| `resolvedExecutable` is unexpectedly null. | |
| `resolvedExecutable` is unexpectedly `null`. |
lrhn
reviewed
Mar 20, 2026
| try { | ||
| return p.dirname(p.dirname(Platform.resolvedExecutable)); | ||
| } on Exception { | ||
| } catch (_) { |
Member
There was a problem hiding this comment.
Alternatively, use on Object. The (_) feels a little spurious.
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.
In some internal platform implementation the
resolvedExecutableisunexpectedly
nulland causes aTypeError. Generalize the catch toignore all errors, not just exceptions.