From def5a00415ebced58bb0f7c1254f6cbedb27a23f Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 23 Jan 2013 09:23:18 +0100 Subject: make raising not found error less confusing --- app/controllers/application_controller.rb | 3 --- users/app/controllers/webfinger_controller.rb | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a1ea008..06b245a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,7 +3,4 @@ class ApplicationController < ActionController::Base ActiveSupport.run_load_hooks(:application_controller, self) - def not_found - raise RECORD_NOT_FOUND.new('Not Found') - end end diff --git a/users/app/controllers/webfinger_controller.rb b/users/app/controllers/webfinger_controller.rb index d3a4ad3..f28dd3e 100644 --- a/users/app/controllers/webfinger_controller.rb +++ b/users/app/controllers/webfinger_controller.rb @@ -10,7 +10,8 @@ class WebfingerController < ApplicationController def search username = params[:q].split('@')[0].to_s.downcase - user = User.find_by_login(username) || not_found + user = User.find_by_login(username) + raise RECORD_NOT_FOUND, 'User not found' unless user.present? @subject = Webfinger::UserPresenter.new(user, request) respond_with @subject end -- cgit v1.2.3