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.
/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)
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:in
read' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:144:inblock (2 levels) in fill_image_with_tiles' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:143:in
each' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:143:ineach_with_index' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:143:in
block in fill_image_with_tiles' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:140:intimes' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:140:in
fill_image_with_tiles' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/map.rb:40:inrender_map' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/lib/mapstatic/cli.rb:48:in
map' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:inrun' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in
invoke_command' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:indispatch' from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in
start' from /var/lib/gems/1.9.1/gems/mapstatic-0.0.1/bin/mapstatic:7:in<top (required)>' from /usr/local/bin/mapstatic:23:in
load' 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)