Exception: Walinko::ValidationError

Inherits:
ApiError show all
Defined in:
lib/walinko/errors.rb

Overview

422 — semantic validation failure. For DTO validation errors (the default class-validator path), ‘#fields` returns a `=> [reason, …]` map. For `phone_not_on_whatsapp` the map is empty and the reason is in `#message`.

Instance Attribute Summary

Attributes inherited from ApiError

#body, #details, #error_code, #http_status, #request_id

Instance Method Summary collapse

Methods inherited from ApiError

#initialize, #inspect

Constructor Details

This class inherits a constructor from Walinko::ApiError

Instance Method Details

#fieldsHash{String => Array<String>}

Returns:

  • (Hash{String => Array<String>})


86
87
88
89
# File 'lib/walinko/errors.rb', line 86

def fields
  f = details[:fields] || details['fields']
  f.is_a?(Hash) ? f : {}
end