Skip to content

[BUG] CLI shows low-level permission error when output directory is not writable #1842

@sahillllllllll-bit

Description

@sahillllllllll-bit

Describe the bug.

When generating output to a directory without write permissions (for example /root/output), the AsyncAPI Generator fails with a low-level filesystem error (EACCES). The error message is not user-friendly and does not explain how to resolve the issue, such as choosing a writable directory or adjusting directory permissions.

Expected behavior

When the output directory is not writable, the CLI should display a clear, user-friendly error message explaining that permission is denied and suggesting actionable steps, such as using a directory with write access or adjusting permissions.

Screenshots

Image

How to Reproduce

  1. Prepare a valid AsyncAPI specification file (for example asyncapi.yaml).
  2. Run the AsyncAPI Generator with an output directory that is not writable by the current user:
    asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o /root/output
    
  3. Observe that the command fails with a low-level permission error.

🖥️ Device Information [optional]

  • Operating System (OS) Windows (WSL)
  • Browser: N/A
  • Browser Version: N/A

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions