tsdjs / tsd

Check TypeScript type definitions
MIT License
2.4k stars 67 forks source link

Errors getting logged without call stack or context #137

Closed JoshuaKGoldberg closed 1 year ago

JoshuaKGoldberg commented 2 years ago

In reproducing https://github.com/SamVerschueren/tsd/issues/136, what you actually see on the terminal is:

$ tsd
Cannot read properties of undefined (reading 'flags')

No call stack. It's quite confusing.

The culprit is logging only the message here: https://github.com/SamVerschueren/tsd/blob/354f77d97315045770c1a94a4f16ef507c865dbd/source/cli.ts#L30

Could we have, say, a message like Error running tsd: ${error.stack || error.message} please? I'd be happy to send a PR!