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

location2cb/get_vans.py: improve error reporting #3

Open
fgalan opened this issue Sep 17, 2013 · 0 comments
Open

location2cb/get_vans.py: improve error reporting #3

fgalan opened this issue Sep 17, 2013 · 0 comments
Assignees

Comments

@fgalan
Copy link
Member

fgalan commented Sep 17, 2013

Currently, the script doesn't handle error conditions due to LOCS unavailability, e.g.:

$ ./get_vans.py
Usage: python get_vans.py [period (default = 5 seconds)] [times (default once) (0 = forever)]
Technician A (34669079467):
Traceback (most recent call last):
  File "./get_vans.py", line 59, in <module>
    main()
  File "./get_vans.py", line 54, in main
    print_positions()
  File "./get_vans.py", line 28, in print_positions
    locs.get_location(locs.technician_A)
  File "/home/test2/fiware-livedemoapp/package/location2cb/locs_sim.py", line 260, in get_location
    longitude = location["terminalLocation"][0]["currentLocation"]["latitude"]
KeyError: 'currentLocation'

In this case, an error should be printed, e.g.:

$ ./get_vans.py
Usage: python get_vans.py [period (default = 5 seconds)] [times (default once) (0 = forever)]
LOCS service unavailable

@ghost ghost assigned sergiogarciag Sep 17, 2013
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

2 participants