Exception: Cloudflare::BindingError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cloudflare_workers.rb

Overview

Base error class for Cloudflare binding failures. Wraps the JS error message so Ruby rescue can handle it meaningfully.

Direct Known Subclasses

D1Error, KVError, R2Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, binding_type: nil, operation: nil) ⇒ BindingError

Returns a new instance of BindingError.



450
451
452
453
454
# File 'lib/cloudflare_workers.rb', line 450

def initialize(message, binding_type: nil, operation: nil)
  @binding_type = binding_type
  @operation = operation
  super("[Cloudflare::#{binding_type}] #{operation}: #{message}")
end

Instance Attribute Details

#binding_typeObject (readonly)

Returns the value of attribute binding_type.



448
449
450
# File 'lib/cloudflare_workers.rb', line 448

def binding_type
  @binding_type
end

#operationObject (readonly)

Returns the value of attribute operation.



448
449
450
# File 'lib/cloudflare_workers.rb', line 448

def operation
  @operation
end