Skip to content

[API] Swallowed async errors — Discord setup, Redis subs, job queues, unhandled rejections #376

@Flegma

Description

@Flegma

Summary

Multiple async operations use void prefix or lack error handlers, causing errors to be silently swallowed.

Findings

  • AppModule — void this.discordBot.setup() not awaited, errors silently swallowed.
  • SocketsService — Redis subscriptions and message handlers called with void, no error handlers.
  • MatchesModule — multiple queue.add() calls with void, queue failures swallowed.
  • main.ts — unhandledRejection handler only logs warning, doesn't exit or recover.

Impact

Service degradation goes unnoticed. Discord bot, Redis, or job queues could fail silently.

Suggested Fix

  • Await critical async ops or add .catch() handlers.
  • Add proper recovery to unhandledRejection handler.

Related Issues (Error Handling Pattern)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highStability & reliabilityaudit-2026-03From March 2026 codebase auditerror-handlingMissing or incorrect error handlingservice:api5stackgg/api service

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions