Browse Source

Fix method return when rescuing

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
852c82435d
2 changed files with 3 additions and 0 deletions
  1. +2
    -0
      app/services/fetch_remote_account_service.rb
  2. +1
    -0
      app/services/fetch_remote_status_service.rb

+ 2
- 0
app/services/fetch_remote_account_service.rb View File

@ -21,7 +21,9 @@ class FetchRemoteAccountService < BaseService
return FollowRemoteAccountService.new.call("#{username}@#{domain}")
rescue TypeError => e
Rails.logger.debug "Unparseable URL given: #{url}"
nil
rescue Nokogiri::XML::XPath::SyntaxError
Rails.logger.debug "Invalid XML or missing namespace"
nil
end
end

+ 1
- 0
app/services/fetch_remote_status_service.rb View File

@ -33,5 +33,6 @@ class FetchRemoteStatusService < BaseService
return FollowRemoteAccountService.new.call("#{username}@#{domain}")
rescue Nokogiri::XML::XPath::SyntaxError
Rails.logger.debug "Invalid XML or missing namespace"
nil
end
end

Loading…
Cancel
Save