Exception: ViewModel::DeserializationError::SchemaVersionMismatch
- Inherits:
-
InvalidRequest
- Object
- StandardError
- AbstractError
- AbstractErrorWithBlame
- ViewModel::DeserializationError
- InvalidRequest
- ViewModel::DeserializationError::SchemaVersionMismatch
- Defined in:
- lib/view_model/deserialization_error.rb
Overview
A view included an unexpected schema version for the corresponding viewmodel.
Instance Attribute Summary collapse
-
#schema_version ⇒ Object
readonly
Returns the value of attribute schema_version.
-
#viewmodel_class ⇒ Object
readonly
Returns the value of attribute viewmodel_class.
Attributes inherited from AbstractErrorWithBlame
Instance Method Summary collapse
- #detail ⇒ Object
-
#initialize(viewmodel_class, schema_version, nodes) ⇒ SchemaVersionMismatch
constructor
A new instance of SchemaVersionMismatch.
- #meta ⇒ Object
Methods inherited from ViewModel::DeserializationError
Methods inherited from AbstractError
#aggregation?, #causes, #code, #exception, #status, #title, #to_s, #view
Constructor Details
#initialize(viewmodel_class, schema_version, nodes) ⇒ SchemaVersionMismatch
Returns a new instance of SchemaVersionMismatch.
128 129 130 131 132 |
# File 'lib/view_model/deserialization_error.rb', line 128 def initialize(viewmodel_class, schema_version, nodes) @viewmodel_class = viewmodel_class @schema_version = schema_version super(nodes) end |
Instance Attribute Details
#schema_version ⇒ Object (readonly)
Returns the value of attribute schema_version.
126 127 128 |
# File 'lib/view_model/deserialization_error.rb', line 126 def schema_version @schema_version end |
#viewmodel_class ⇒ Object (readonly)
Returns the value of attribute viewmodel_class.
126 127 128 |
# File 'lib/view_model/deserialization_error.rb', line 126 def viewmodel_class @viewmodel_class end |
Instance Method Details
#detail ⇒ Object
134 135 136 137 |
# File 'lib/view_model/deserialization_error.rb', line 134 def detail "Mismatched schema version for type #{viewmodel_class.view_name}, "\ "expected #{viewmodel_class.schema_version}, received #{schema_version}." end |
#meta ⇒ Object
139 140 141 142 |
# File 'lib/view_model/deserialization_error.rb', line 139 def super.merge(expected: viewmodel_class.schema_version, received: schema_version) end |