Skip to content

Commit

Permalink
Only hide Screenshot exceptions in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Jul 21, 2016
1 parent 545ba5e commit 894a44c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/screenshot.rb
Expand Up @@ -41,6 +41,7 @@ def thumbnail_path(fetch: true)
# rescue Errno::ETIMEDOUT, Net::ReadTimeout, OpenURI::HTTPError => e
# And also there is a chance of exception generating the thumbnail
rescue Exception => e
raise unless Rails.env.production?
Rails.logger.debug("No screenshot fetched for: " + pkg_name)
default_file_path(:thumbnail, fullpath: false)
end
Expand Down Expand Up @@ -70,6 +71,7 @@ def blob(type = :screenshot)
# rescue Errno::ETIMEDOUT, Net::ReadTimeout, OpenURI::HTTPError => e
# And also there is a chance of exception generating the thumbnail
rescue Exception => e
raise unless Rails.env.production?
Rails.logger.debug("No screenshot fetched (blob) for: " + pkg_name)
default_blob(type)
end
Expand Down

0 comments on commit 894a44c

Please sign in to comment.