Skip to content

fix: offline advisory DB unavailable error should include the sync command to create it #402

@sonukapoor

Description

@sonukapoor

Problem

When --offline or --offline-db is used but the database does not exist or cannot be opened, the error is:

Error: Offline advisory database is not available: <reason>

There is no hint on how to create the database. Users — especially those setting up offline mode for the first time — are left stuck.

Expected behaviour

Error: Offline advisory database is not available: <reason>
To build it, run: cve-lite advisories sync
Or to save it to a custom path: cve-lite advisories sync --output /path/to/advisories.db

Where to look

src/index.ts — around line 153 where the offline DB availability check throws.

Acceptance criteria

  • The error message includes the cve-lite advisories sync command
  • When --offline-db <path> was passed, the hint also shows --output <path> so the user knows where to save it
  • Tests updated to assert the new message text

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions