Exception: Turbocable::SerializationError
- Defined in:
- lib/turbocable/errors.rb
Overview
Raised when the configured codec cannot serialize the given payload. Carries the codec name and payload class for diagnosis.
Instance Attribute Summary collapse
-
#codec_name ⇒ Symbol
readonly
The codec that failed (e.g.
:json). -
#payload_class ⇒ Class
readonly
The class of the payload that could not be serialized.
Instance Method Summary collapse
-
#initialize(message, codec_name:, payload_class:) ⇒ SerializationError
constructor
A new instance of SerializationError.
Constructor Details
#initialize(message, codec_name:, payload_class:) ⇒ SerializationError
Returns a new instance of SerializationError.
32 33 34 35 36 |
# File 'lib/turbocable/errors.rb', line 32 def initialize(, codec_name:, payload_class:) super() @codec_name = codec_name @payload_class = payload_class end |
Instance Attribute Details
#codec_name ⇒ Symbol (readonly)
Returns the codec that failed (e.g. :json).
24 25 26 |
# File 'lib/turbocable/errors.rb', line 24 def codec_name @codec_name end |
#payload_class ⇒ Class (readonly)
Returns the class of the payload that could not be serialized.
27 28 29 |
# File 'lib/turbocable/errors.rb', line 27 def payload_class @payload_class end |