morko / salabot

Discord bot framework
Apache License 2.0
0 stars 0 forks source link

exit app if trying to add plugins before initializing the bot #18

Open morko opened 5 years ago

morko commented 5 years ago

Currently the application just keeps running and the error might be missed.

2019-01-29 15:35:04 [verbose]:  Initializing the bot...
(node:7136) UnhandledPromiseRejectionWarning: Error: You must call init() before adding plugins!
    at Bot.addModule (C:\Users\oskar\workspace\node\salabot-demo\node_modules\salabot\src\Bot.js:92:13)
    at Object.<anonymous> (C:\Users\oskar\workspace\node\salabot-demo\src\bot.js:9:5)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\oskar\workspace\node\salabot-demo\index.js:5:11)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
(node:7136) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7136) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.