apify / apify-shared-js

Utilities and constants shared across Apify projects.
https://www.npmjs.com/package/@apify/utilities
Apache License 2.0
12 stars 11 forks source link

feat: log error causes (without breaking things this time) #438

Closed vladfrangu closed 9 months ago

vladfrangu commented 9 months ago

This is the proper reimplementation of https://github.com/apify/apify-shared-js/pull/428 & revert of https://github.com/apify/apify-shared-js/pull/434

image

import log from '@apify/log';

const err = new Error('Some error');
const errWithCause = new Error('Some error with cause', { cause: err });
const errWithNestedCause = new Error('Some error with nested cause', { cause: errWithCause });

log.exception(errWithNestedCause);
barjin commented 9 months ago

I suppose the screenshot isn't directly 1:1 from the code, right? The error messages don't match 😅

vladfrangu commented 9 months ago

I suppose the screenshot isn't directly 1:1 from the code, right? The error messages don't match 😅

I deleted the script before pushing to the branch 😢, but the only difference between the code and the screenshot is the error message (the rest is the same)