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

CLI exit fails if eLink unplugged #1

Closed
elpollouk opened this issue Jan 31, 2020 · 2 comments
Closed

CLI exit fails if eLink unplugged #1

elpollouk opened this issue Jan 31, 2020 · 2 comments
Milestone

Comments

@elpollouk
Copy link
Owner

  1. Start CLI with eLink plugged in
  2. Unplug eLink
  3. Execute exit command

Following callstack reported:

dcc> exit
Error: Port is not open
    at SerialPort.close (C:\Projects\Itokawa\node_modules\@serialport\stream\lib\index.js:426:29)
    at C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:87:24
    at new Promise (<anonymous>)
    at AsyncSerialPort.close (C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:86:16)
    at ELinkCommandStation.<anonymous> (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:103:30)
    at Generator.next (<anonymous>)
    at C:\Projects\Itokawa\dist\devices\commandStations\elink.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:4:12)
    at ELinkCommandStation.close (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:99:16)
dcc> exit
TypeError: Cannot read property 'close' of null
    at C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:87:24
    at new Promise (<anonymous>)
    at AsyncSerialPort.close (C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:86:16)
    at ELinkCommandStation.<anonymous> (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:103:30)
    at Generator.next (<anonymous>)
    at C:\Projects\Itokawa\dist\devices\commandStations\elink.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:4:12)
    at ELinkCommandStation.close (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:99:16)
    at C:\Projects\Itokawa\dist\cli\main.js:53:31
dcc>

Exit command doesn't work

@elpollouk
Copy link
Owner Author

The correct fix for this is to update the CLI to use the same application object as the server so that they can share the same error handling logic.

@elpollouk
Copy link
Owner Author

Fixed with commit 2f9498c

@elpollouk elpollouk added this to the Release 0.1 milestone Nov 27, 2020
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

1 participant