diff options
author | rhenium <re4k@re4k.info> | 2013-05-18 20:27:20 +0900 |
---|---|---|
committer | rhenium <re4k@re4k.info> | 2013-05-18 20:27:20 +0900 |
commit | 28ef1eda1cb1d0810a49fbbacee5d7628e531001 (patch) | |
tree | 3a974d3b7f4779a31d8d0a0bc5326d550f67c846 /app/controllers/errors_controller.rb | |
parent | 0b01cf035bb7c8048e9d69e59a0fc8176e4fb06c (diff) | |
download | aclog-28ef1eda1cb1d0810a49fbbacee5d7628e531001.tar.gz |
update error handling
Diffstat (limited to 'app/controllers/errors_controller.rb')
-rw-r--r-- | app/controllers/errors_controller.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index e1d5dcf..eac8028 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding: utf-8 -*- class ErrorsController < ApplicationController layout "index" skip_before_filter :check_format @@ -13,20 +14,28 @@ class ErrorsController < ApplicationController # /i/callback redirect_to root_path when Aclog::Exceptions::TweetNotFound + @message = "ツイートが見つかりませんでした。" render "error", status: 404 when Aclog::Exceptions::UserNotFound + @message = "ユーザーが見つかりませんでした。" render "error", status: 404 when Aclog::Exceptions::UserNotRegistered + @message = "ユーザーは aclog に登録していません。" render "error", status: 404 when Aclog::Exceptions::UserProtected + @message = "ユーザーは非公開です。" render "error", status: 403 when Aclog::Exceptions::LoginRequired + @message = "このページの表示にはログインが必要です。" render "error", status: 403 when Aclog::Exceptions::OAuthEchoUnauthorized + @message = "OAuth Echo 認証に失敗しました。" render "error", status: 401 when ActionController::RoutingError + @message = "このページは存在しません。" render "error", status: 404 else + @message = "Internal Error: #{@exception.class}" render "error", status: 500 end end |