Exception: Assinafy::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/assinafy/errors.rb,
sig/assinafy.rbs

Overview

Raised before a network request is made when the caller's input is invalid (missing IDs, wrong shape, etc.).

Instance Attribute Summary collapse

Attributes inherited from Error

#context

Instance Method Summary collapse

Constructor Details

#initialize(message = 'Validation failed', errors = {}) ⇒ ValidationError

Returns a new instance of ValidationError.

Parameters:

  • message (String) (defaults to: 'Validation failed')
  • errors (Hash[Symbol | String, untyped], nil) (defaults to: {})


74
75
76
77
# File 'lib/assinafy/errors.rb', line 74

def initialize(message = 'Validation failed', errors = {})
  super(message, { errors: errors })
  @errors = errors || {}
end

Instance Attribute Details

#errorsHash (readonly)

Returns field-keyed validation details.

Returns:

  • (Hash)

    field-keyed validation details



72
73
74
# File 'lib/assinafy/errors.rb', line 72

def errors
  @errors
end