Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will enhance the logging of error messages in catch blocks (the javascript Error object). Due to a problem on wiston, when logging an error object, the winston just prints the messages, and all important details (like error line, etc,) is hidden. Details: winstonjs/winston#1338 For example, if I'm developing a module or something fails with an Error, this is what is printed in the wiki.js log: 2022-09-16T02:31:41.383Z [MASTER] info: ======================================= 2022-09-16T02:31:41.385Z [MASTER] info: = Wiki.js 2.5.286 ===================== 2022-09-16T02:31:41.385Z [MASTER] info: ======================================= 2022-09-16T02:31:41.386Z [MASTER] info: Initializing... 2022-09-16T02:31:42.334Z [MASTER] info: Using database driver pg for postgres [ OK ] 2022-09-16T02:31:42.337Z [MASTER] info: Connecting to database... 2022-09-16T02:31:42.501Z [MASTER] info: Database Connection Successful [ OK ] 2022-09-16T02:31:43.507Z [MASTER] warn: Mail is not setup! Please set the configuration in the administration area! 2022-09-16T02:31:43.675Z [MASTER] info: Loading GraphQL Schema... 2022-09-16T02:31:45.155Z [MASTER] info: GraphQL Schema: [ OK ] 2022-09-16T02:31:45.437Z [MASTER] error: SOME_ERROR is not defined After this fix, the error is printed with more info: Loading configuration from T:\powerdocs\wikijs\config.yml... OK 2022-09-16T02:32:08.650Z [MASTER] info: ======================================= 2022-09-16T02:32:08.652Z [MASTER] info: = Wiki.js 2.5.286 ===================== 2022-09-16T02:32:08.653Z [MASTER] info: ======================================= 2022-09-16T02:32:08.653Z [MASTER] info: Initializing... 2022-09-16T02:32:09.627Z [MASTER] info: Using database driver pg for postgres [ OK ] 2022-09-16T02:32:09.632Z [MASTER] info: Connecting to database... 2022-09-16T02:32:09.897Z [MASTER] info: Database Connection Successful [ OK ] 2022-09-16T02:32:10.932Z [MASTER] warn: Mail is not setup! Please set the configuration in the administration area! 2022-09-16T02:32:11.116Z [MASTER] info: Loading GraphQL Schema... 2022-09-16T02:32:12.949Z [MASTER] info: GraphQL Schema: [ OK ] 2022-09-16T02:32:13.276Z [MASTER] error: ReferenceError: SOME_ERROR is not defined at module.exports (T:\wikijs\server\master.js:172:3) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.bootMaster (T:\wikijs\server\core\kernel.js:60:9)
- Loading branch information