Skip to content

Error messaging + idling resource registration - #48

Merged
Kritarie merged 1 commit into
masterfrom
improve-error-messaging
Sep 16, 2026
Merged

Kritarie merged 1 commit into
masterfrom
improve-error-messaging

Conversation

@Kritarie

Copy link
Copy Markdown
Contributor

Improve error messaging when a screenshot directory can't be created. Also ensure the idling resource is un-registered in the event of an exception.

… Also ensure the idling resource is un-registered in the event of an exception.
@Kritarie
Kritarie requested a review from cmathew September 15, 2026 17:20
Comment thread .editorconfig

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This more closely aligns with how we configure formatting rules in wf-android
https://www.jetbrains.com/help/idea/editorconfig.html
Without this my IDE was formatting with 4 spaces, which didn't align with the rest of the codebase


try {
createDirectories(Path(screenshotDirectory))
} catch (e: Exception) {

@cmathew cmathew Sep 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which exceptions might the try block throw? Should we just let it bubble up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually a java.nio.file.FileSystemException. Reason I'm catching it is just to wrap the exception to provide a more context-specific error message (and include the directory path we tried)

@Kritarie
Kritarie merged commit 015d2c8 into master Sep 16, 2026
1 check passed
@Kritarie
Kritarie deleted the improve-error-messaging branch September 16, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants