Skip to content

Commit

Permalink
fix(error): addressed pr comments & error in test run
Browse files Browse the repository at this point in the history
Signed-off-by: Santanu Roy <[email protected]>
  • Loading branch information
Santanu Roy committed Dec 28, 2023
1 parent f4ab97b commit e70eb40
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions packages/concerto-core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ class ScalarDeclaration extends Declaration {
+ boolean isEvent()
+ boolean isConcept()
}
class StringValidatorException extends Error {
+ void constructor(string,string)
}
class TransactionDeclaration extends IdentifiedDeclaration {
+ void constructor(ModelFile,Object) throws IllegalModelException
+ string declarationKind()
Expand Down
3 changes: 2 additions & 1 deletion packages/concerto-core/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#

Version 3.13.3 {b286dfdeeb654d25be7c5f9cc6305e38} 2023-11-07
Version 3.13.3 {1df986a8e13fe0d984069b9637c0a1c4} 2023-11-07
- Added DCS and vocabulary extraction support for decoratorManager
- Added StringValidatorException class to support error type

Version 3.13.2 {dccc690753912cf87e7ceec56d949058} 2023-10-18
- Add getNamespace method to key type and value type of maps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
'use strict';

/**
* Class representing an validation error related to anykind of string validatoin in introspect
* Class representing an validation error related to anykind of string validation in introspect
* @class
* @memberof module:concerto-core
*/
class StringValidationException extends Error {
class StringValidatorException extends Error {
/**
* Create error related to string validation.
* @param {string} errormessage - The exception message.
* @param {string} errorType - conditional parameter which denoted the kind of string
* @param {string} errorType - conditional parameter which denotes/represents the kind of string
* error , defaults to StringValidationError if not provided
*/
constructor(errormessage,errorType) {
Expand All @@ -34,5 +34,5 @@ class StringValidationException extends Error {

}

module.exports = StringValidationException;
module.exports = StringValidatorException;

4 changes: 2 additions & 2 deletions packages/concerto-core/lib/introspect/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const StringValidationException = require('./stringvalidatorexception');
const StringValidatorException = require('./stringvalidatorexception');

// Types needed for TypeScript generation.
/* eslint-disable no-unused-vars */
Expand Down Expand Up @@ -52,7 +52,7 @@ class Validator {
* @throws {Error} throws an error to report the message
*/
reportError(id, msg, errorType='ValidatorError') {
throw new StringValidationException('Validator error for field `' + id + '`. ' + this.getFieldOrScalarDeclaration().getFullyQualifiedName() + ': ' + msg ,errorType);
throw new StringValidatorException('Validator error for field `' + id + '`. ' + this.getFieldOrScalarDeclaration().getFullyQualifiedName() + ': ' + msg ,errorType);
}

/**
Expand Down

0 comments on commit e70eb40

Please sign in to comment.