Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/concerto-core/src/introspect/classdeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class ClassDeclaration extends Declaration {
// not the last element, get the class of the element
if (n < propertyNames.length - 1) {
if (result.isPrimitive() || result.isTypeEnum()) {
throw new Error('Property ' + propertyNames[n] + ' is a primitive or enum. Invalid property path: ' + propertyPath);
throw new IllegalModelException('Property ' + propertyNames[n] + ' is a primitive or enum. Invalid property path: ' + propertyPath, this.modelFile, this.ast.location);
} else {
// get the nested type, this throws if the type is missing or if the type is an enum
classDeclaration = classDeclaration.getModelFile().getModelManager().getType(result.getFullyQualifiedTypeName());
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/test/introspect/classdeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ describe('ClassDeclaration', () => {
});
it('get error with primitives', function() {
let extremeOuter = modelManager.getType('com.hyperledger.testing@1.0.0.ExtremeOuter');
(()=>{extremeOuter.getNestedProperty('outerAsset.int.innerAsset');}).should.throw(/Property int is a primitive or enum/);
(()=>{extremeOuter.getNestedProperty('outerAsset.int.innerAsset');}).should.throw(IllegalModelException, /Property int is a primitive or enum/);
});
});

Expand Down
Loading