Fix iOS crash by handling ENOENT file not found exception in Posix #2662
+3
−0
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.
Fix iOS crash by handling ENOENT file not found exception in Posix
The fix modifies the access native method in Posix.java to return false (NO) instead of throwing an ErrnoException when the system error code is ENOENT (file not found). This prevents the application from crashing when LogManager (triggered implicitly by Guava's Platform initialization) checks for the existence of configuration files that are not present on iOS. By treating a missing file as a simple boolean failure rather than a fatal exception, File.exists() behaves correctly, allowing the logging system to fall back to its default configuration gracefully.