Commit 62f3863d authored by azul's avatar azul

Merge branch '265-undefined-method-error-for-nil-nilclass-in-rescue-block-for-notice' into 'master'

Resolve "undefined method `error' for nil:NilClass in rescue block for Notice"

Closes #265

See merge request !239
parents 52b5b107 05f9df17
......@@ -35,7 +35,7 @@ class EntitiesController < ApplicationController
#
def members
group = Group.find_by_name(params[:group])
logger.error params[:group]
Rails.logger.error params[:group]
if current_user.may?(:see_members, group)
if preload?
group.users
......
......@@ -10,8 +10,8 @@ module Me::NoticesHelper
def noticable_url(notice)
send(notice.redirect_path, notice.redirect_object)
rescue NoMethodError => e
logger.error 'Error: ' + e.message
logger.error e.backtrace.join("\n")
Rails.logger.error 'Error: ' + e.message
Rails.logger.error e.backtrace.join("\n")
return nil
end
end
......@@ -50,9 +50,9 @@ module Asset::Upload
asset = create_from_params uploaded_data: FileData.new(tmp_file)
assets << asset if asset
rescue => exc
logger.fatal("Error while extracting asset #{tmp_file} from ZIP Archive: #{exc.message}")
Rails.logger.fatal("Error while extracting asset #{tmp_file} from ZIP Archive: #{exc.message}")
exc.backtrace.each do |bt|
logger.fatal(bt)
Rails.logger.fatal(bt)
end
begin
failures << entry.name
......
......@@ -68,8 +68,8 @@ class Mailer::PageHistories < ActionMailer::Base
begin
GPGME::Key.import File.open(ENV['GPGKEY'])
rescue => e
logger.error 'Error: ' + e.message
logger.error e.backtrace.join("\n")
Rails.logger.error 'Error: ' + e.message
Rails.logger.error e.backtrace.join("\n")
end
# TODO: email address should be configurable
gpg_options.merge sign_as: "robot@riseup.net"
......
......@@ -113,7 +113,7 @@ module Page::Index
# fire off background task
MiddleMan.worker(:indexing_worker).async_update_page_terms(arg: id)
rescue BackgrounDRb::NoServerAvailable => err
logger.error "Warning: #{err}; performing synchronous update of page index"
Rails.logger.error "Warning: #{err}; performing synchronous update of page index"
update_page_terms
end
else
......
......@@ -120,7 +120,7 @@ class Thumbnail < ActiveRecord::Base
def thumbdef
definition = parent.thumbdefs[name.to_sym]
if definition.blank?
logger.error "Error: No thumbnail definition found for #{name} #{id}"
Rails.logger.error "Error: No thumbnail definition found for #{name} #{id}"
end
definition
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment