Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions of stop of measurement(s) if currently no measurements are running #12

Closed
ebroda opened this issue Mar 25, 2020 · 1 comment

Comments

@ebroda
Copy link

ebroda commented Mar 25, 2020

Thank you for the nice cli. It works fine, but I just had an issue with the cli when no measurement is going on, but I want to stop it.

Situation: No measurement is currently runnning.

Situation A:
Selecting "Stop all active measurements"

Expected:
Message: "Currently no measurements were running." and return to menu, like at "List active measurements".

Result:

(node:1124) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
    at Promise (/snapshot/kimai2-cmd/kimai2-cmd.js:320:55)
    at new Promise (<anonymous>)
    at callKimaiStop (/snapshot/kimai2-cmd/kimai2-cmd.js:318:12)
    at kimaiList.then.res (/snapshot/kimai2-cmd/kimai2-cmd.js:300:28)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1124) 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: 2)
(node:1124) [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.

and I need to restart the tool.

Situation B:
Select "Stop an active measurement". This shows no running measurments, but allows to select/enter which leads to an error:

Expected:
same as above.

Result:

(node:1136) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
    at ListPrompt.getCurrentValue (/snapshot/kimai2-cmd/node_modules/inquirer/lib/prompts/list.js:121:53)
    at MapSubscriber._next (/snapshot/kimai2-cmd/node_modules/rxjs/internal/operators/map.js:0:0)
    at MapSubscriber.Subscriber.next (/snapshot/kimai2-cmd/node_modules/rxjs/internal/Subscriber.js:66:18)
    at TakeSubscriber._next (/snapshot/kimai2-cmd/node_modules/rxjs/internal/operators/take.js:0:0)
    at TakeSubscriber.Subscriber.next (/snapshot/kimai2-cmd/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Interface.handler (/snapshot/kimai2-cmd/node_modules/rxjs/internal/observable/fromEvent.js:22:28)
    at Interface.emit (events.js:194:15)
    at Interface._onLine (readline.js:290:10)
    at Interface._line (readline.js:638:8)
    at Interface._ttyWrite (readline.js:919:14)
(node:1136) 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:1136) [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.

and I need to restart the tool.

infeeeee added a commit that referenced this issue Mar 25, 2020
@infeeeee infeeeee mentioned this issue Mar 25, 2020
@infeeeee
Copy link
Owner

Thank you for the bug report! Fixed it in this commit: 49d9752
I will create a new release and update builds soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants