Exception: Mistri::WorkspaceConflictError

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

Overview

A conditional document write lost to a different committed version. The revisions stay off the message so a stale full replacement cannot borrow a fresh token without reading the matching content.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, expected_revision: nil, actual_revision: nil) ⇒ WorkspaceConflictError

Returns a new instance of WorkspaceConflictError.



129
130
131
132
133
134
# File 'lib/mistri/errors.rb', line 129

def initialize(path, expected_revision: nil, actual_revision: nil)
  @path = path.to_s.dup.freeze
  @expected_revision = expected_revision.nil? ? nil : expected_revision.to_s.dup.freeze
  @actual_revision = actual_revision.nil? ? nil : actual_revision.to_s.dup.freeze
  super("document #{@path.inspect} changed; read it again before retrying")
end

Instance Attribute Details

#actual_revisionObject (readonly)

Returns the value of attribute actual_revision.



127
128
129
# File 'lib/mistri/errors.rb', line 127

def actual_revision
  @actual_revision
end

#expected_revisionObject (readonly)

Returns the value of attribute expected_revision.



127
128
129
# File 'lib/mistri/errors.rb', line 127

def expected_revision
  @expected_revision
end

#pathObject (readonly)

Returns the value of attribute path.



127
128
129
# File 'lib/mistri/errors.rb', line 127

def path
  @path
end