Skip to content

Errors while serving a request can crash Node.js #52

@leccelecce

Description

@leccelecce

This is a follow on from #32

Sometimes, usually due to a null value, I get a crash in the app. I'm used to building webapps in Java frameworks, and normally a crash while serving a client request would throw an exception, but not terminate the entire app.

I assume there is a way to handle this more gracefully in Node.js

D:\GitProjects\Lineup-List>node dist\server.js
LINEUPLIST_FORCE_HTTP set, skipping certs and starting an http ONLY local server
Resetting customize page to last known state and recieved unknown tracktype: null or undefined
D:\GitProjects\Lineup-List\dist\redis-helper.js:205
            for (const artistId of artistIds) {
                                   ^

TypeError: artistIds is not iterable
    at Object.<anonymous> (D:\GitProjects\Lineup-List\dist\redis-helper.js:205:36)
    at Generator.next (<anonymous>)
    at fulfilled (D:\GitProjects\Lineup-List\dist\redis-helper.js:28:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions