Skip to content
New issue

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

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

Already on GitHub? # to your account

hw_CANSocket errors could be shown in the web interface #84

Closed
DePierre opened this issue Mar 12, 2017 · 2 comments
Closed

hw_CANSocket errors could be shown in the web interface #84

DePierre opened this issue Mar 12, 2017 · 2 comments
Assignees

Comments

@DePierre
Copy link
Contributor

Hi there,

Nothing urgent there, only a first-time user experience I wanted to share with you.

Trying out with the hw_CANSocket module, I noticed that the exceptions raised during errors were only shown in the console but not in the interface. For instance, with the following broken configuration:

load_modules = {
    'hw_CANSocket': {'iface':'vcanINVALID', 'speed': 500},
    'mod_stat': {}
}

actions = [
    {'hw_CANSocket': {'action': 'read','pipe': 1}}
    {'mod_stat': {'action': 'read', 'pipe': 1}}
]

Clicking on Start/Stop will show the following exception in the console:

$ python3 cantoolz.py -g w -c can_socket.py


   _____          _   _ _______          _
  / ____|   /\   | \ | |__   __|        | |
 | |       /  \  |  \| |  | | ___   ___ | |____
 | |      / /\ \ | . ` |  | |/ _ \ / _ \| |_  /
 | |____ / ____ \| |\  |  | | (_) | (_) | |/ /
  \_____/_/    \_\_| \_|  |_|\___/ \___/|_/___|



('CANtoolz WEB started at port: ', 4444)
	To exit CTRL-C...
[*] HTTPD: Received connection from 127.0.0.1
[*] HTTPD: Received connection from 127.0.0.1
[*] HTTPD: Received connection from 127.0.0.1
[*] HTTPD: Received connection from 127.0.0.1
[*] HTTPD: Received connection from 127.0.0.1
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
hw_CANSocket: ERROR: [Errno 19] No such device
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/start HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/start HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:31] "GET /api/status HTTP/1.1" 200 -
127.0.0.1 - - [12/Mar/2017 17:46:32] "GET /api/status HTTP/1.1" 200 -
^CPlease wait... (do not press ctr-c again!)
gg bb
pop@debian:~/can/CANToolz$ 

But nothing on the web interface. Checking the module status, it shows Current status: True but nothing more.

It would be more pertinent to have:

  • The full stack trace in the console (for troubleshooting purpose)
  • The exception name in the web interface (for user-friendliness)

To reproduce, simply run cantoolz with the configuration above and click on Start/Stop in the web interface.

@eik00d
Copy link
Owner

eik00d commented Mar 13, 2017

Hi!

First of all - thank you for the good advises and interest to the project.
I will try to implement both ideas this week.

BR,
Alexey

@eik00d eik00d self-assigned this Mar 16, 2017
@eik00d eik00d closed this as completed Mar 17, 2017
@eik00d
Copy link
Owner

eik00d commented Mar 17, 2017

Fixed at #88

eik00d added a commit that referenced this issue Mar 31, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants