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

Handle connection loss more gracefully #32

Closed
oskay opened this issue Jun 7, 2017 · 0 comments
Closed

Handle connection loss more gracefully #32

oskay opened this issue Jun 7, 2017 · 0 comments
Milestone

Comments

@oskay
Copy link
Contributor

oskay commented Jun 7, 2017

If the USB cable is unplugged while plotting, one might get an error message like:

Failed after command: SM,30,333,-266
Failed after command: SM,30,265,-212
Failed after command: SM,30,200,-160
Failed after command: SM,30,133,-106
Failed after command: SM,30,66,-53
Error reading serial data.
Traceback (most recent call last):
  File "axidraw.py", line 2100, in <module>
    e.affect()
  File "/Applications/Inkscape_091.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 285, in affect
    self.effect()
  File "axidraw.py", line 280, in effect
    self.plotDocument()
  File "axidraw.py", line 554, in plotDocument
    self.recursivelyTraverseSvg( self.svg, self.svgTransform )
  File "axidraw.py", line 625, in recursivelyTraverseSvg
    self.recursivelyTraverseSvg( node, matNew, parent_visibility=v )		
  File "axidraw.py", line 683, in recursivelyTraverseSvg
    self.plotPath( node, matNew )
  File "axidraw.py", line 1157, in plotPath
    self.plotSegmentWithVelocity( fX, fY, 0, 0)
  File "axidraw.py", line 1951, in plotSegmentWithVelocity
    if strButton[0] == '1': #button pressed
IndexError: string index out of range

This would be better served by a shorter error message of the form "Lost connectivity to AxiDraw. Did the USB cable get unplugged?"

@oskay oskay added this to the 1.6.0 milestone Oct 20, 2017
@oskay oskay closed this as completed in e4039aa Oct 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant