2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 09:57:10 +00:00

fix: FatalError set reference to causing error (#1257)

This commit is contained in:
ivanjh 2025-04-15 21:33:09 +10:00 committed by GitHub
parent 766b4344a8
commit 12d28f3958
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,10 @@ exports.FatalError = class FatalError extends exports.BaseError {
const error = (typeof data === 'string') ? null : data;
const message = error ? error.message : data;
super('EFATAL', message);
if (error) this.stack = error.stack;
if (error) {
this.stack = error.stack;
this.cause = error;
}
}
};