user-flow icon indicating copy to clipboard operation
user-flow copied to clipboard

Add trace to our errors

Open BioPhoton opened this issue 3 years ago • 0 comments

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

BioPhoton avatar Nov 02 '22 23:11 BioPhoton