comparison app/controllers/tweets_controller.rb @ 25:70d70736faee

Properly rescue 403 and 404.
author edogawaconan <me@myconan.net>
date Fri, 05 Sep 2014 23:38:57 +0900
parents 207917e41964
children 03f904c070f7
comparison
equal deleted inserted replaced
24:c1783bab9035 25:70d70736faee
1 class TweetsController < ApplicationController 1 class TweetsController < ApplicationController
2 def show 2 def show
3 @tweets = Tweet.new(params[:id]).timeline 3 @tweets = Tweet.new(params[:id]).timeline
4 @user = @tweets.first.user 4 @user = @tweets.first.user
5 rescue Twitter::Error::NotFound
6 head :not_found
7 rescue Twitter::Error::Unauthorized
8 head :forbidden
5 end 9 end
6 end 10 end