ggreer / jekyll-gallery-generator

A Jekyll plugin that generates photo galleries from directories full of images.
Apache License 2.0
367 stars 68 forks source link

Crash when trying to generate thumbnails in directory without permission #19

Closed danners closed 9 years ago

danners commented 9 years ago

Hey, i run it by mistake on dir the user had no permission on. I think the could should have catched it. It crashed with the following trace:

remote: Error generating galleries: class or module required for rescue clause remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:168:in rescue in block in initialize' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:163:inblock in initialize' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:125:in foreach' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:125:ininitialize' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:218:in new' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:218:inblock in generate' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:215:in foreach' remote: /home/simon/tmp/myrepo/_plugins/jekyll-gallery-generator.rb:215:ingenerate' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:280:in block in generate' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:279:ineach' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:279:in generate' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:50:inprocess' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in process_site' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:inbuild' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in process' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:inblock (2 levels) in init_with_program' remote: /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in call' remote: /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:inblock in execute' remote: /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in each' remote: /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:inexecute' remote: /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in go' remote: /var/lib/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:inprogram' remote: /var/lib/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in <top (required)>' remote: /usr/local/bin/jekyll:23:inload' remote: /usr/local/bin/jekyll:23:in `

' remote: jekyll 2.5.3 | Error: Permission denied @ rb_sysopen - /home/simon/deployed_blog/photos/index.html

ggreer commented 9 years ago

Instead of crashing, what would you rather have it do? There's no way to recover from such an error.