1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-22 22:12:45 +01:00

Print a stacktrace for uncaught errors in plugins (if it exists) (#466)

This commit is contained in:
Govert de Gans 2024-06-03 03:15:08 +02:00 committed by GitHub
parent ddc05ad9c7
commit 4dbc0b39de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1106,8 +1106,13 @@ export class Controller {
await (plugin as (controller: Controller) => Promise<void>)(this)
} catch (e) {
log(LogLevel.ERROR, `Error while evaluating plugin ${pluginName}!`)
log(LogLevel.ERROR, e)
log(
LogLevel.ERROR,
`Error while evaluating plugin ${pluginName}!`,
"plugins",
)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
log(LogLevel.ERROR, (e as any)?.stack ?? e, "plugins")
}
}