breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.01k stars 78 forks source link

bree.remove #137

Closed kanonochina closed 2 years ago

kanonochina commented 2 years ago

bree.remove is causing error when job does not exist, I wrapped it on a try catch block but it still leads to an error.

shadowgate15 commented 2 years ago

Can you show us some code? and what the error is?

kanonochina commented 2 years ago

here is the error I get when a job cannot be found

    Error: Job "0ec9b1302fd706a4b120ce860f3f962e_sms" does not exist
    at Bree._callee2$ (/home/analytics/apps/BreeService/node_modules/bree/lib/index.js:699:23)
    at tryCatch (/home/analytics/apps/BreeService/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/home/analytics/apps/BreeService/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:294:22)
    at Generator.next (/home/analytics/apps/BreeService/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:119:21)
    at asyncGeneratorStep (/home/analytics/apps/BreeService/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/home/analytics/apps/BreeService/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
    at /home/analytics/apps/BreeService/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
    at new Promise (<anonymous>)
    at Bree.<anonymous> (/home/analytics/apps/BreeService/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
    at Bree.remove (/home/analytics/apps/BreeService/node_modules/bree/lib/index.js:719:24)
    at app.get (/home/analytics/apps/BreeService/server/index.js:207:11)
    at Layer.handle [as handle_request] (/home/analytics/apps/BreeService/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/analytics/apps/BreeService/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/analytics/apps/BreeService/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/analytics/apps/BreeService/node_modules/express/lib/router/layer.js:95:5)
    at /home/analytics/apps/BreeService/node_modules/express/lib/router/index.js:281:22
shadowgate15 commented 2 years ago

Please provide us with some example code in order to reproduce this issue.

shadowgate15 commented 2 years ago

I'm closing this for now. Feel free to reopen if you can give us some sample code.