Exception: AtlasRb::LinkedMemberError
- Defined in:
- lib/atlas_rb/errors.rb
Overview
Authorization failures surface as ForbiddenError (HTTP 403).
Raised when Atlas rejects a linked-member write
(POST / DELETE /works/:id/linked_members) with a 422 carrying a
machine-readable error discriminator. The linked-member sibling of
ReparentError; same shape, same rationale (the binding would otherwise
discard the envelope on a non-2xx).
rescue AtlasRb::LinkedMemberError => e flash.now[:alert] = t("linked_member.errors.#ee.code", default: e.message)
Instance Attribute Summary collapse
-
#code ⇒ String?
readonly
The machine-readable error code from the envelope, suitable for keying an i18n map.
-
#resource_id ⇒ String?
readonly
The rejected resource's ID, from the envelope.
Instance Method Summary collapse
-
#initialize(message, code: nil, resource_id: nil) ⇒ LinkedMemberError
constructor
A new instance of LinkedMemberError.
Constructor Details
#initialize(message, code: nil, resource_id: nil) ⇒ LinkedMemberError
Returns a new instance of LinkedMemberError.
97 98 99 100 101 |
# File 'lib/atlas_rb/errors.rb', line 97 def initialize(, code: nil, resource_id: nil) super() @code = code @resource_id = resource_id end |
Instance Attribute Details
#code ⇒ String? (readonly)
Returns the machine-readable error code from the envelope, suitable for keying an i18n map.
89 90 91 |
# File 'lib/atlas_rb/errors.rb', line 89 def code @code end |
#resource_id ⇒ String? (readonly)
Returns the rejected resource's ID, from the envelope.
92 93 94 |
# File 'lib/atlas_rb/errors.rb', line 92 def resource_id @resource_id end |