Exception: AtlasRb::ForbiddenError
- Defined in:
- lib/atlas_rb/errors.rb
Overview
Scoped to the re-parent / linked-member write paths and the
Compilation surface — 403s on other endpoints still surface as raw
responses for the caller's own rescue layer, unchanged.
Raised when Atlas refuses a re-parent, linked-member, or Compilation
request with an HTTP 403, whose envelope is
{ "error", "action", "subject" }. Lets callers distinguish "you may
not do this" from a structural rejection (ReparentError /
LinkedMemberError / CompilationError) or a not-found.
Instance Attribute Summary collapse
-
#action ⇒ String?
readonly
The action that was forbidden (e.g.
"reparent"). -
#code ⇒ String?
readonly
The envelope's
errorvalue. -
#subject ⇒ String?
readonly
The subject (resource) the action was forbidden on.
Instance Method Summary collapse
-
#initialize(message, code: nil, action: nil, subject: nil) ⇒ ForbiddenError
constructor
A new instance of ForbiddenError.
Constructor Details
#initialize(message, code: nil, action: nil, subject: nil) ⇒ ForbiddenError
Returns a new instance of ForbiddenError.
160 161 162 163 164 165 |
# File 'lib/atlas_rb/errors.rb', line 160 def initialize(, code: nil, action: nil, subject: nil) super() @code = code @action = action @subject = subject end |
Instance Attribute Details
#action ⇒ String? (readonly)
Returns the action that was forbidden (e.g. "reparent").
151 152 153 |
# File 'lib/atlas_rb/errors.rb', line 151 def action @action end |
#code ⇒ String? (readonly)
Returns the envelope's error value.
148 149 150 |
# File 'lib/atlas_rb/errors.rb', line 148 def code @code end |
#subject ⇒ String? (readonly)
Returns the subject (resource) the action was forbidden on.
154 155 156 |
# File 'lib/atlas_rb/errors.rb', line 154 def subject @subject end |