Skip to content

Add trace to our errors #84

@BioPhoton

Description

@BioPhoton

It is nice to have a user friendly error message but we also need to have a way to understand the real cause. therefore I suggest to add the traces from the original error to the new one.

Example of missing traces:
Error while running user flows. TypeError: Cannot set properties of undefined (setting 'config')

It would be really helpful to see the actual file and the full trace here.

Solution:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause

try {
  connectToDatabase();
} catch (err) {
  throw new Error('Connecting to database failed.', { cause: err });
}

TODO:

  • Improve Error for serve command - Error while executing npm run start:ssr:prod
  • adopt tsconfig to latest es version so the 'cause' feature works
  • add cause to all catched or thrown errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDeveloper ExperiencebugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions