Skip to content

fix: show error details in preset catalog config read failure - #3840

Merged
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/presets-show-error
Aug 10, 2026
Merged

fix: show error details in preset catalog config read failure#3840
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/presets-show-error

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

Capture and display exception message when reading preset-catalogs.yml fails.

Changes

  • _commands.py: Added as e to except clause and display error details

Copilot AI left a comment

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.

Pull request overview

Improves preset catalog removal errors by displaying the underlying configuration-read exception.

Changes:

  • Captures and prints configuration read failure details.
Show a summary per file
File Description
src/specify_cli/presets/_commands.py Adds exception details to catalog removal errors.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/specify_cli/presets/_commands.py
Capture and display the exception message when reading preset-catalogs.yml
fails, instead of swallowing the error details. Matches the pattern used
in preset_catalog_add 54 lines earlier.

Copilot AI left a comment

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.

Review details

Suppressed comments (1)

src/specify_cli/presets/_commands.py:769

  • Escape the exception text before passing it to Rich. YAML parser errors can echo the invalid source line; if that line contains an unmatched tag such as [/red], console.print raises MarkupError here and the command shows a traceback instead of the intended read error. The equivalent add path already escapes str(e) at lines 708–710.
        console.print(f"[red]Error:[/red] Failed to read preset catalog config: {e}")
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@mnriem
mnriem merged commit 44c3dc7 into github:main Aug 10, 2026
14 checks passed
@mnriem

mnriem commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants