diff options
author | re4k <re4k@re4k.info> | 2013-03-28 02:11:40 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-03-28 02:11:40 +0900 |
commit | 295db76b7643868456eafb98cf760a5e383b41ed (patch) | |
tree | 054845af698810440ce1b96324618fb05ee67cb2 /app/views/errors/error.json.jbuilder | |
parent | b4972590475eb595bc88f6ee47125fe8ca6e1fb2 (diff) | |
download | aclog-295db76b7643868456eafb98cf760a5e383b41ed.tar.gz |
Refactor
Diffstat (limited to 'app/views/errors/error.json.jbuilder')
-rw-r--r-- | app/views/errors/error.json.jbuilder | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/views/errors/error.json.jbuilder b/app/views/errors/error.json.jbuilder new file mode 100644 index 0000000..8dab39a --- /dev/null +++ b/app/views/errors/error.json.jbuilder @@ -0,0 +1,24 @@ +json.error do |json| + json.status response.status + case @exception + when Aclog::Exceptions::TweetNotFound + json.message "ツイートが見つかりませんでした。" + when Aclog::Exceptions::UserNotFound + json.message "ユーザーが見つかりませんでした。" + when Aclog::Exceptions::UserNotRegistered + json.message "ユーザーは aclog に登録していません。" + when Aclog::Exceptions::UserProtected + json.message "ユーザーは非公開です。" + when Aclog::Exceptions::LoginRequired + json.message "このページの表示にはログインが必要です。" + when ActionController::RoutingError + json.message "不正な URL です。" + else + if response.status == 404 + json.message "Not Found (Unknown)" + else + json.message "Internal Error (Unknown)" + end + end + json.exception @exception.class.to_s +end |