Stop if no error.stack

This commit is contained in:
Corwin 2022-12-14 12:03:46 +01:00 committed by GitHub
parent b6e1a2eae4
commit 8d03b65a60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,6 +187,7 @@ process.on('unhandledRejection', error => {
console.error('Unhandled promise rejection:', error);
if (error) if (error.length > 950) error = error.slice(0, 950) + '... view console for details';
if (error.stack) if (error.stack.length > 950) error.stack = error.stack.slice(0, 950) + '... view console for details';
if(!error.stack) return
const embed = new Discord.EmbedBuilder()
.setTitle(`🚨・Unhandled promise rejection`)
.addFields([