Skip to content

fix(cli): include path in global config I/O errors - #945

Open
Beehtrix wants to merge 1 commit into
getsotto:mainfrom
Beehtrix:cursor/config-io-path-876-1798
Open

Beehtrix wants to merge 1 commit into
getsotto:mainfrom
Beehtrix:cursor/config-io-path-876-1798

Conversation

@Beehtrix

@Beehtrix Beehtrix commented Dec 2, 2026 •

Copy link
Copy Markdown

Fixes #876

Summary

This pull request improves error messages for global configuration I/O operations by including the relevant file and directory paths along with the specific operation being performed (reading, creating, or writing).

Changes

  • Updated GlobalConfig::load_from to include the file path and operation context when an I/O error occurs while reading the configuration file.
  • Updated GlobalConfig::save_to to include path and operation context when encountering errors creating parent directories or writing the configuration file.
  • Added comprehensive unit tests (load_invalid_utf8_names_path_and_reading_operation, save_to_directory_path_names_writing_operation, and save_parent_obstructed_by_file_names_creating_operation) to verify that the generated I/O error messages contain the correct path information and operation descriptors.

Surface the attempted path and operation (reading/creating/writing) in
GlobalConfig load_from/save_to Error::Io messages so failures are
diagnosable when SOTTO_DATA_DIR or a space-containing path is involved.

Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Co-authored-by: Beehtrix <Beehtrix@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings December 2, 2026 00:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@sotto-review

sotto-review Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Sotto finished reviewing this pull request.

This branch has not been deployed

No deployments
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.

CLI: global configuration I/O errors omit the failing path

2 participants