diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-05 13:26:44 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-05 13:26:44 +0200 |
commit | fe77921e4733b330e69a9f2db8be5de9ecefc8af (patch) | |
tree | 1c16f064097824740d3a2a80480b73f61e0d9afe /app/controllers | |
parent | b0788854141a98da8fc4da1dbbfaf2a3239e3760 (diff) |
Catching more exceptions that slipped through, removing AR logging from
production as it's very verbose and not very useful
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/application_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/stream_entries_controller.rb | 15 |
3 files changed, 19 insertions, 6 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index c550b38e8..4ccf20bc9 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -18,6 +18,10 @@ class ApiController < ApplicationController 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 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c8d7e2084..1f991cf67 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -30,6 +30,12 @@ class ApplicationController < ActionController::Base end end + def gone + respond_to do |format| + format.any { head 410 } + end + end + def current_account current_user.try(:account) end diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb index e1b664b08..a364fa01c 100644 --- a/app/controllers/stream_entries_controller.rb +++ b/app/controllers/stream_entries_controller.rb @@ -8,13 +8,16 @@ class StreamEntriesController < ApplicationController 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 |