Skip to content

Bug: Admin uploads route does not log errors on failure #407

@Rohhit333

Description

@Rohhit333

Description

  • In the adminUploads route, failures are handled without logging the underlying error. While all other functions in the adminRoutes file properly log errors, this function is the only one that fails silently.
  • When an exception occurs here, the request may fail or return a generic response, but the actual error is not recorded in logs.
  • This inconsistency makes debugging and production monitoring difficult, especially for admin-only functionality where reliability and traceability are important.

Problem

In the admin uploads route:

  • Errors are caught or allowed to fail silently
  • No structured logging (e.g., console.error / logger) is performed
  • Important context (error message, stack trace) is lost
Image

As a result:

  • Failures are hard to diagnose
  • Admin-facing issues may go unnoticed
  • Production debugging becomes significantly harder

Expected Behavior

  • All unexpected errors in admin upload routes should be logged
  • Logs should include enough context to debug the failure
  • The route should remain safe and predictable even when failures occur

Suggested Solution

  • Add explicit error logging inside the catch block or error handler
  • Log the error object (and stack trace where applicable)
  • Keep the response behavior unchanged if desired, but ensure failures are observable

Example (conceptual):

Image

Impact

  • Improves debuggability
  • Makes admin uploads more reliable in production
  • Helps future contributors diagnose issues faster

@pradeeban @mdxabu Please assign this issue to me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions