Skip to content

Comments

fix: create parent directories and improve error messages when saving diagrams#68

Merged
vobu merged 3 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60-yet-again
Feb 18, 2026
Merged

fix: create parent directories and improve error messages when saving diagrams#68
vobu merged 3 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Addresses feedback from #60: writeFileSync would throw cryptic errors when --output pointed to non-existent directories.

Changes

  • Auto-create parent directories: Use mkdirSync(parentDir, {recursive: true}) before writing diagram files
  • Actionable error messages: Catch and translate filesystem errors into clear guidance:
    • EACCES → "Permission denied writing to {path}. Check file permissions."
    • ENOSPC → "No space left on device when writing to {path}."
    • EROFS → "Cannot write to {path}: read-only file system."
    • Fallback includes original error message
  • Test coverage: Added integration test verifying diagram saves to nested non-existent paths like /tmp/xyz/nested/path/diagram.png

Example

# Previously failed with cryptic ENOENT
c8ctl get pi --key 123 --diagram --output ./reports/2024/diagram.png

# Now auto-creates ./reports/2024/ and saves diagram

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on rendering PI diagram fix: create parent directories and improve error messages when saving diagrams Feb 18, 2026
Copilot AI requested a review from vobu February 18, 2026 14:16
@vobu vobu marked this pull request as ready for review February 18, 2026 14:21
@vobu vobu merged commit 0f11ae1 into feat/process-instance-diagram Feb 18, 2026
1 check passed
@vobu vobu deleted the copilot/sub-pr-60-yet-again branch February 18, 2026 14:21
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.

2 participants