]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Fix rubocop lint issues
[rails.git] / app / controllers / application_controller.rb
index e3f0391d14717e03dc4c78a63ac28010df2d1daf..5ef50eb3f1d0bd34d6fdbee8ce6f3f735f3af693 100644 (file)
@@ -24,13 +24,13 @@ class ApplicationController < ActionController::Base
         else
           redirect_to :controller => "user", :action => "terms", :referer => request.fullpath
         end
         else
           redirect_to :controller => "user", :action => "terms", :referer => request.fullpath
         end
-        end
+      end
     elsif session[:token]
       if @user = User.authenticate(:token => session[:token])
         session[:user] = @user.id
       end
     end
     elsif session[:token]
       if @user = User.authenticate(:token => session[:token])
         session[:user] = @user.id
       end
     end
-  rescue Exception => ex
+  rescue StandardError => ex
     logger.info("Exception authorizing user: #{ex}")
     reset_session
     @user = nil
     logger.info("Exception authorizing user: #{ex}")
     reset_session
     @user = nil
@@ -345,7 +345,7 @@ class ApplicationController < ActionController::Base
     report_error ex.message, ex.status
   rescue AbstractController::ActionNotFound => ex
     raise
     report_error ex.message, ex.status
   rescue AbstractController::ActionNotFound => ex
     raise
-  rescue Exception => ex
+  rescue StandardError => ex
     logger.info("API threw unexpected #{ex.class} exception: #{ex.message}")
     ex.backtrace.each { |l| logger.info(l) }
     report_error "#{ex.class}: #{ex.message}", :internal_server_error
     logger.info("API threw unexpected #{ex.class} exception: #{ex.message}")
     ex.backtrace.each { |l| logger.info(l) }
     report_error "#{ex.class}: #{ex.message}", :internal_server_error
@@ -441,7 +441,7 @@ class ApplicationController < ActionController::Base
                @user.preferred_editor
              else
                DEFAULT_EDITOR
                @user.preferred_editor
              else
                DEFAULT_EDITOR
-    end
+             end
 
     if request.env['HTTP_USER_AGENT'] =~ /MSIE|Trident/ && editor == 'id'
       editor = 'potlatch2'
 
     if request.env['HTTP_USER_AGENT'] =~ /MSIE|Trident/ && editor == 'id'
       editor = 'potlatch2'