Exception: LabelZoom::ValidationError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/labelzoom/errors.rb

Overview

A request rejected locally, before any network call.

Deliberately an ArgumentError and not an APIError: this is a bug in the calling code, not a server response. It carries no status, it is never retried, and a caller rescuing APIError to implement fallback behaviour should not swallow it.

This is also what makes conformance/skips/ruby.json's stated reason literally true: Ruby has no compile step, so a source-only format passed as a target is caught here.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameter, message) ⇒ ValidationError

Returns a new instance of ValidationError.



87
88
89
90
# File 'lib/labelzoom/errors.rb', line 87

def initialize(parameter, message)
  super(message)
  @parameter = parameter
end

Instance Attribute Details

#parameterString (readonly)

Returns the conversion parameter at fault, named as it appears on the wire.

Returns:

  • (String)

    the conversion parameter at fault, named as it appears on the wire.



85
86
87
# File 'lib/labelzoom/errors.rb', line 85

def parameter
  @parameter
end