Show connection error to the user #318

Merged
merged 4 commits into from Jan 23, 2013

Projects

None yet

2 participants

@hroncok

Before, when there was an error while connecting, user didn't know, when
Pronterface wasn't launched from the terminal.

So you could just hit Connect button several times and all you've get was:

Connecting...
Connecting...
Connecting...

Now, when there is an exception during the connection, the user will notice:

Connecting...
Error: You are trying to connect to a non-exisiting port.

Or:

Connecting...
Error: You don't have permission to open /dev/ttyUSB0.
You might need to add yourself to the dialout group.

Unfortunately pyserial's SerialException doesn't provide errno yet, so the
message isn't so user friendly:

Connecting...
could not open port None: [Errno 2] No such file or directory: 'None'

I've filled a bug report with patch to pyserial.

Together with this I've realised, there is unnecessary UTF8 decoding of the
output. When user has UTF-8 locale, there was an exception when printing the
exception to the output (almost an exception inception). So I have dropped it,
but feel free to add it back, if I broke anything else.

@hroncok hroncok Tell the user, there was an error while connecting
Before, when there was an error while connecting, user didn't know, when
Pronterface wasn't launched from the terminal.

So you could just hit Connect button several times and all you've get was:
Connecting...
Connecting...
Connecting...

Now, when there is an exception during the connection, the user will notice:
Connecting...
Error: You are trying to connect to a non-exisiting port.

Or:
Connecting...
Error: You don't have permission to open /dev/ttyUSB0.
You might need to add yourself to the dialout group.

Unfortunately pyserial's SerialException doesn't provide errno yet, so the
message isn't so user friendly:
Connecting...
could not open port None: [Errno 2] No such file or directory: 'None'

I've filled a bug report with patch to pyserial.

Together with this I've realised, there is unnecessary UTF8 decoding of the
output. When user has UTF-8 locale, there was an exception when printing the
exception to the output (almost an exception inception). So I have dropped it,
but feel free to add it back, if I broke anything else.
f942c1a
@kliment
Owner

If the encoding isn't there, then the output will be decoded as ascii. This is a problem because it generates an exception for non-ascii characters. The bootloaders on several reprap electronics generate such characters on reset.

@hroncok

OK, I'll drop it, so you can take the rest.

@kliment
Owner
@hroncok

Now it should work.

@kliment kliment merged commit 71e5da0 into kliment:master Jan 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment