annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
1 class TweetsController < ApplicationController
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
2 def show
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
3 @tweets = Tweet.new(params[:id]).timeline
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
4 @user = @tweets.first.user
25
70d70736faee Properly rescue 403 and 404.
edogawaconan <me@myconan.net>
parents: 15
diff changeset
5 rescue Twitter::Error::NotFound
70d70736faee Properly rescue 403 and 404.
edogawaconan <me@myconan.net>
parents: 15
diff changeset
6 head :not_found
70d70736faee Properly rescue 403 and 404.
edogawaconan <me@myconan.net>
parents: 15
diff changeset
7 rescue Twitter::Error::Unauthorized
70d70736faee Properly rescue 403 and 404.
edogawaconan <me@myconan.net>
parents: 15
diff changeset
8 head :forbidden
15
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
9 end
207917e41964 Add tweets~
edogawaconan <me@myconan.net>
parents:
diff changeset
10 end