render json: { error: 'Remote data could not be fetched' }, status: 503
end
+ rescue_from OpenSSL::SSL::SSLError do
+ render json: { error: 'Remote SSL certificate could not be verified' }, status: 503
+ end
+
protected
def current_resource_owner
end
end
+ def gone
+ respond_to do |format|
+ format.any { head 410 }
+ end
+ end
+
def current_account
current_user.try(:account)
end
def show
@type = @stream_entry.activity_type.downcase
- if @stream_entry.activity_type == 'Status'
- @ancestors = @stream_entry.activity.ancestors
- @descendants = @stream_entry.activity.descendants
- end
-
respond_to do |format|
- format.html
+ format.html do
+ return gone if @stream_entry.activity.nil?
+
+ if @stream_entry.activity_type == 'Status'
+ @ancestors = @stream_entry.activity.ancestors
+ @descendants = @stream_entry.activity.descendants
+ end
+ end
+
format.atom
end
end
else
return process_html(fetch(url))
end
+
+ rescue OpenSSL::SSL::SSLError => e
+ Rails.logger.debug "SSL error: #{e}"
end
private
Rails.logger.debug "Going to webfinger #{username}@#{domain}"
return FollowRemoteAccountService.new.call("#{username}@#{domain}")
+ rescue Nokogiri::XML::XPath::SyntaxError
+ Rails.logger.debug "Invalid XML or missing namespace"
end
end
Rails.logger.debug "Going to webfinger #{username}@#{domain}"
return FollowRemoteAccountService.new.call("#{username}@#{domain}")
+ rescue Nokogiri::XML::XPath::SyntaxError
+ Rails.logger.debug "Invalid XML or missing namespace"
+ end
end
end
config.action_mailer.delivery_method = :smtp
config.react.variant = :production
+
+ config.active_record.logger = nil
end