diff options
author | Rhenium <rhenium@rhe.jp> | 2014-03-11 21:23:02 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-03-11 21:23:02 +0900 |
commit | 7c392ca7735a36948515a392b544ace60a242838 (patch) | |
tree | 7d887731c549decf33d23018268e5e974b16a2cd /lib | |
parent | 71c2069595618cb048c8e04c577902c08fc20a57 (diff) | |
download | aclog-7c392ca7735a36948515a392b544ace60a242838.tar.gz |
reorganize exceptions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/aclog/exceptions.rb | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/lib/aclog/exceptions.rb b/lib/aclog/exceptions.rb index 5eafc99..1a58755 100644 --- a/lib/aclog/exceptions.rb +++ b/lib/aclog/exceptions.rb @@ -1,26 +1,20 @@ module Aclog module Exceptions - class UserError < StandardError - attr_reader :user - def initialize(user) - @user = user - end - end + class AclogError < StandardError; end + class NotFound < AclogError; end + class Forbidden < AclogError; end + class Unauthorized < AclogError; end - class UserNotFound < StandardError; end - class LoginRequired < StandardError; end - class TweetNotFound < StandardError; end - class OAuthEchoUnauthorized < StandardError; end + class UserNotFound < NotFound; end + class TweetNotFound < NotFound; end + class UserNotRegistered < NotFound; end + class DocumentNotFound < NotFound; end - class UserNotRegistered < UserError; end - class UserProtected < UserError; end - class AccountPrivate < UserError; end + class UserProtected < Forbidden; end + class AccountPrivate < Forbidden; end - class DocumentNotFound < StandardError; end + class OAuthEchoError < Unauthorized; end - class AclogError < StandardError; end - class NotFound < AclogError; end - class Forbidden < AclogError; end - class OAuthEchoError < AclogError; end + class OAuthEchoUnauthorized < OAuthEchoError; end end end |