fix error logging
This commit is contained in:
parent
c841b53bdd
commit
492cdba631
1 changed files with 11 additions and 0 deletions
|
@ -100,6 +100,17 @@ export default async function (matrixClient, event, room, toStartOfTimeline) {
|
|||
}
|
||||
} catch (error) {
|
||||
logger.log("error", error.stack)
|
||||
try {
|
||||
const errorcontent = {
|
||||
body: `Message: ${clean(err)}\n\nStack Trace: ${clean(err.stack)}`,
|
||||
msgtype: "m.text"
|
||||
}
|
||||
matrixClient.sendEvent(event.event.room_id, "m.room.message", errorcontent, "", (err, res) => {
|
||||
console.log(err);
|
||||
});
|
||||
} catch (e) {
|
||||
_error(`While attempting to send the previous error message, another error occurred: ${e.stack || e}`);
|
||||
}
|
||||
// if (error.toString().includes("Request entity too large")) {
|
||||
// await client.rest.channels.createMessage(event.event.room_id, Object.assign({
|
||||
// content: "The resulting file was too large to upload. Try again with a smaller image if possible."
|
||||
|
|
Loading…
Reference in a new issue