Exception: Turbocable::PayloadTooLargeError
- Defined in:
- lib/turbocable/errors.rb
Overview
Raised when the encoded payload exceeds config.max_payload_bytes. The limit is checked client-side before touching NATS so callers get a useful error rather than a cryptic NATS-level rejection.
Instance Attribute Summary collapse
-
#byte_size ⇒ Integer
readonly
The byte size of the encoded payload.
-
#limit ⇒ Integer
readonly
The configured limit.
Instance Method Summary collapse
-
#initialize(byte_size:, limit:) ⇒ PayloadTooLargeError
constructor
A new instance of PayloadTooLargeError.
Constructor Details
#initialize(byte_size:, limit:) ⇒ PayloadTooLargeError
Returns a new instance of PayloadTooLargeError.
95 96 97 98 99 |
# File 'lib/turbocable/errors.rb', line 95 def initialize(byte_size:, limit:) super("Encoded payload is #{byte_size} bytes, exceeding the #{limit}-byte limit") @byte_size = byte_size @limit = limit end |
Instance Attribute Details
#byte_size ⇒ Integer (readonly)
Returns the byte size of the encoded payload.
88 89 90 |
# File 'lib/turbocable/errors.rb', line 88 def byte_size @byte_size end |
#limit ⇒ Integer (readonly)
Returns the configured limit.
91 92 93 |
# File 'lib/turbocable/errors.rb', line 91 def limit @limit end |