Exception: KeycloakSdk::AdminError

Inherits:
Error
  • Object
show all
Defined in:
lib/keycloak_sdk/errors.rb

Overview

Admin REST 오류(HTTP status 보존).

Direct Known Subclasses

ConflictError, ForbiddenError, NotFoundError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil) ⇒ AdminError

Returns a new instance of AdminError.



30
31
32
33
# File 'lib/keycloak_sdk/errors.rb', line 30

def initialize(message = nil, status: nil)
  super(message)
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



28
29
30
# File 'lib/keycloak_sdk/errors.rb', line 28

def status
  @status
end

Class Method Details

.from_status(status, message) ⇒ Object

status → 적절한 하위 예외 인스턴스.



36
37
38
39
40
41
42
43
# File 'lib/keycloak_sdk/errors.rb', line 36

def self.from_status(status, message)
  case status
  when 404 then NotFoundError.new(message, status: status)
  when 409 then ConflictError.new(message, status: status)
  when 403 then ForbiddenError.new(message, status: status)
  else AdminError.new(message, status: status)
  end
end