mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
better failure message on version conflict, its not the required version, its the provided version
This commit is contained in:
parent
8b92b2b780
commit
94c526925b
@ -27,12 +27,26 @@ import org.elasticsearch.rest.RestStatus;
|
|||||||
*/
|
*/
|
||||||
public class VersionConflictEngineException extends EngineException {
|
public class VersionConflictEngineException extends EngineException {
|
||||||
|
|
||||||
public VersionConflictEngineException(ShardId shardId, String type, String id, long current, long required) {
|
private final long current;
|
||||||
super(shardId, "[" + type + "][" + id + "]: version conflict, current [" + current + "], required [" + required + "]");
|
|
||||||
|
private final long provided;
|
||||||
|
|
||||||
|
public VersionConflictEngineException(ShardId shardId, String type, String id, long current, long provided) {
|
||||||
|
super(shardId, "[" + type + "][" + id + "]: version conflict, current [" + current + "], provided [" + provided + "]");
|
||||||
|
this.current = current;
|
||||||
|
this.provided = provided;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RestStatus status() {
|
public RestStatus status() {
|
||||||
return RestStatus.CONFLICT;
|
return RestStatus.CONFLICT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getCurrentVersion() {
|
||||||
|
return this.current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getProvidedVersion() {
|
||||||
|
return this.provided;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user