Ruby on rails 如何将自定义字符串和值传递给Rails中的ExceptionNotifier?
在从异常中营救时,我有以下代码:Ruby on rails 如何将自定义字符串和值传递给Rails中的ExceptionNotifier?,ruby-on-rails,exception-handling,Ruby On Rails,Exception Handling,在从异常中营救时,我有以下代码: rescue Exceptions::LogoNotCroppable => ex logger.error "Logo was not croppable LogoID: #{self.id}. Exception message: #{ex.message}" ex.backtrace.each { |line| logger.debug line } # Send email with notification that somethin
rescue Exceptions::LogoNotCroppable => ex
logger.error "Logo was not croppable LogoID: #{self.id}. Exception message: #{ex.message}"
ex.backtrace.each { |line| logger.debug line }
# Send email with notification that something did not go as expected
ExceptionNotifier.notify_exception(ex)
但是,如果我想传递通知之外的内容,我该怎么做呢?例如,如果要使用数据哈希传递创建异常的对象的self.id?:
ExceptionNotifier.notify_exception(ex, :data => {:object_id => self.id})