Skip to content

Instantly share code, notes, and snippets.

@mkoby
Forked from mxriverlynn/nil exception.rb
Created February 25, 2011 20:05
Show Gist options
  • Save mkoby/844406 to your computer and use it in GitHub Desktop.
Save mkoby/844406 to your computer and use it in GitHub Desktop.
#I think, to use 'rescue' you need to have a 'begin'
def call_created
begin
callbacks = get_callbacks
if callbacks
callbacks.created(patient, assessment) if callbacks.respond_to?(:created)
end
rescue Exception => ex
puts "......................................#{ex}"
Rails.logger.fatal "Callback method failed"
Rails.logger.fatal ex, ex.backtrace
else
raise
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment