Skip to content

Potential runtime error if SQL query file is missing in salesTracker.js #2

@Miatya

Description

@Miatya

Problem

The loadQueries() method in src/bot/modules/salesTracker.js attempts to read SQL files for queries, but if a SQL file is missing, a warning is logged and the system proceeds. This may lead to runtime errors later if a query is referenced but missing.

Potential Solution

Consider either asserting all queries exist at startup or providing code paths for safer handling when a query is missing.

Relevant code:
See lines 28-55 in salesTracker.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions