def lookup_error_message(exception)
      # TODO: Add in notification hooks for non-standard exceptions.
      name    = lookup_error_name(exception)
      message = default_message_for_exception exception
      context = lookup_error_context(exception).reverse_merge(:scope => :"rocket_pants.errors", :default => message)
      I18n.t name, context.except(:metadata)
    end
def lookup_error_message(exception)
      # TODO: Add in notification hooks for non-standard exceptions.
      name    = lookup_error_name(exception)
      message = default_message_for_exception exception
      context = lookup_error_context(exception).reverse_merge(:scope => :"rocket_pants.errors", :default => message)
      I18n.t name, context.except(:metadata)
    end
From a given exception, gets the corresponding error message using I18n.
 It will use context (if defined) on the exception for the I18n context base and
 will use either the result of Error#error_name (if present) or :system for
 the name of the error.
 @param [StandardError] exception the exception to get the message from
 @return [String] the found error message.