crofty / mapstatic

Static map generator
MIT License
22 stars 12 forks source link

errors are undebuggable #3

Open teo1978 opened 9 years ago

teo1978 commented 9 years ago

Whenever an error occurs, instead of a meaningful error message informing of the real cause of the error (e.g. error downloading map from tile server, or permission denied writing output file or whatever), an incomprehensible stack trace is printed which is of little or no help to the user to figure out what went wrong.

Example: mapstatic map /..../maps/message66181_map.png --zoom=17 --lat=41.8879600 --lng=12.4661800 --width=900 --height=360 --provider=http://a.tile.stamen.com/toner/{z}/{x}/{y}.png

/var/lib/gems/1.9.1/gems/mini_magick-3.6.0/lib/mini_magick.rb:168:in create': MiniMagick::Invalid (MiniMagick::Invalid) from /var/lib/gems/1.9.1/gems/mini_magick-3.6.0/lib/mini_magick.rb:77:inread' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:144:in block (2 levels) in fill_image_with_tiles' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:143:ineach' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:143:in each_with_index' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:143:inblock in fill_image_with_tiles' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:140:in times' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:140:infill_image_with_tiles' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:40:in render_map' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/cli.rb:48:inmap' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in run' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:ininvoke_command' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in dispatch' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:instart' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/bin/mapstatic:7:in <top (required)>' from /usr/local/bin/mapstatic:23:inload' from /usr/local/bin/mapstatic:23:in `

'

Actually, I get that exact error with that exact command randomly. I get it more than 50% of the times. And I can't tell why. Perhaps it's failing to retrieve the tiles from the provider? If that is the case, a clearer error must be given AND a configurable number of retries must be added to make it more robust (but that would be another issue: first we need a decent error reporting to be able to tell whether that is the case)

teo1978 commented 9 years ago

(I can confirm that in my case the error above is due to failure to retrieve tails)