eris
eris copied to clipboard
fix(getMessages): Emit Error object in "error" event
Didn't really know how to title this, apologies if I got it wrong.
Error event err
param should be type Error
- https://github.com/abalabahaha/eris/blob/dev/index.d.ts#L711
It would probably be better to construct the error object, then overwrite the stack Or even just override the message of the caught error then emit it rather than both making a new error object & emitting the original stack
options.cause was added in node 16.9.0, we're currently on v10 (v14 at the latest), so we cannot use it
Went with your original suggestion. Thanks.
We can slice the first line off the stack and remake it with the new message
or we can just ignore the original stack and construct a new error
Any other alternatives to this? Current solution (although error might be hard to read) is the best one imo