sindresorhus/electron-unhandled

Hide stack trace from logError

Aperta

#31 aperta il 28 feb 2023

 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (27 fork)user submission
enhancementhelp wanted

Metriche repository

Star
 (464 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hi, I am using the following code in order to customize the error message shown to the user when a http request fails.

req.on('error', () => {
                const error = new Error('Custom error message.');
                error.stack = null;
                unhandled.logError(error, {
                    title: 'Custom error title'
                });
            });

However, the error popup also shows a stack trace at the end of my message, that I would like to hide, is there any way I can achieve this? image

Guida contributor