Skip to content

Commit 2770614

Browse files
committed
chore: additional validation #1
1 parent 14d3a97 commit 2770614

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const AbstractBasicError = require('../AbstractBasicError');
2+
3+
class DataContractNonUniqueIndexUpdateError extends AbstractBasicError {
4+
/**
5+
* @param {string} documentType
6+
* @param {string} indexName
7+
*/
8+
constructor(documentType, indexName) {
9+
super(`Update of non-unique index failed. Document with type ${documentType} has updated index named "${indexName}" out of spec.`);
10+
11+
this.documentType = documentType;
12+
this.indexName = indexName;
13+
14+
// eslint-disable-next-line prefer-rest-params
15+
this.setConstructorArguments(arguments);
16+
}
17+
18+
/**
19+
* Get document type with changed indices
20+
*
21+
* @returns {string}
22+
*/
23+
getDocumentType() {
24+
return this.documentType;
25+
}
26+
27+
/**
28+
* Get updated index name
29+
*
30+
* @returns {string}
31+
*/
32+
getIndexName() {
33+
return this.indexName;
34+
}
35+
}
36+
37+
module.exports = DataContractNonUniqueIndexUpdateError;

0 commit comments

Comments
 (0)