Skip to content

Implement error logging and exception catching in FolderBrowser#2798

Open
ChristosMaragkos wants to merge 4 commits into
Interkarma:masterfrom
ChristosMaragkos:directory-error-logging
Open

Implement error logging and exception catching in FolderBrowser#2798
ChristosMaragkos wants to merge 4 commits into
Interkarma:masterfrom
ChristosMaragkos:directory-error-logging

Conversation

@ChristosMaragkos

@ChristosMaragkos ChristosMaragkos commented Jun 10, 2026

Copy link
Copy Markdown

FolderBrowser uses Directory.GetDirectories to scan the filesystem, which can throw for numerous reasons (path too long, any subdirectory failing, etc.). This is fine but, currently, in the event of an error:

  • Nothing is communicated to the user
  • The parent directory is not added to the list so the user must click on their filesystem root to get the game back to an interactable state

This PR fixes those issues by:

  • Explicitly adding the .. directory to the list if an exception is caught
  • Logging all directory errors to the console with Unity's APIs

Closes #2796
Be aware that this does not fix any underlying potential issue. It just clearly communicates any errors to the player.

@ChristosMaragkos ChristosMaragkos force-pushed the directory-error-logging branch from ff344ca to 612d665 Compare June 10, 2026 19:31
@ChristosMaragkos

Copy link
Copy Markdown
Author

I also took the liberty of adding a fake directory when an exception is caught to communicate to the user that an error occured in-game. Will revert if too much.

@KABoissonneault

Copy link
Copy Markdown
Collaborator

Did you manage to get any info about your issue from this? Running it should give you the log with the exception now, no?

@ChristosMaragkos

Copy link
Copy Markdown
Author

I wasn't able to because for some reason the game did not fail to scan the directory this time around. Which is a net positive either way.

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.

DFU Fails to show the contents of steamapps/common directory

2 participants