Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #2061
Closed
Open
Issue created Jun 04, 2021 by Zach Levy@zachlevy

Enhancement: Adding Failed Body for extended error objects

I'm sure a lot of projects, including a couple of mine, use extended Error objects

A simple example would be

const err = new Error('An error message');
err.code = 'SOME_APP_ERROR_CODE';
> JSON.stringify(err);
'{"code":"SOME_APP_ERROR_CODE"}'

https://github.com/goldbergyoni/nodebestpractices/blob/master/sections/errorhandling/useonlythebuiltinerror.md#use-only-the-built-in-error-object

In bull, when saving a failed job processing attempt, it stores the stack trace and the error message, it would be great to store any extended error attributes also.

params.failedReason = err.message;
params.failedBody = JSON.stringify(err);
Assignee
Assign to
Time tracking