Exception: Pakyow::InvalidData

Inherits:
Error
  • Object
show all
Defined in:
lib/pakyow/errors.rb

Instance Attribute Summary

Attributes inherited from Error

#context, #wrapped_exception

Instance Method Summary collapse

Methods inherited from Error

build, #cause, #condensed_backtrace, #details, #initialize, #name, new_with_message, #path, #project?

Constructor Details

This class inherits a constructor from Pakyow::Error

Instance Method Details

#contextual_messageObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/pakyow/errors.rb', line 25

def contextual_message
  <<~MESSAGE
    Here's the data:

    #{indent_as_code(JSON.pretty_generate(object))}

    And here are the failures:

    #{indent_as_code(JSON.pretty_generate(result.messages))}
  MESSAGE
end

#objectObject

Object that failed verification.



21
22
23
# File 'lib/pakyow/errors.rb', line 21

def object
  @context[:object]
end

#resultObject

Failed verifier result.



15
16
17
# File 'lib/pakyow/errors.rb', line 15

def result
  @context[:result]
end