Skip to content

Commit

Permalink
Add error message for empty localName
Browse files Browse the repository at this point in the history
  • Loading branch information
ddvlanck committed Feb 8, 2024
1 parent 9128d4f commit 737bb3d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class AttributeConverterHandler extends ConverterHandler<EaAttribute> {
const externalUri: string = getTagValue(attribute, TagNames.ExternalUri, null);
if (externalUri) {
uriRegistry.attributeIdUriMap.set(attribute.id, new URL(externalUri));
return;
}

let attributeBaseURI: string | undefined;
Expand Down Expand Up @@ -137,6 +138,10 @@ export class AttributeConverterHandler extends ConverterHandler<EaAttribute> {
TagNames.LocalName,
attribute.name,
);

if(!localName){
throw new Error(`[AttributeConverterHandler]: Unable to determine local name for attribute (${attribute.path}). If you used a "name" tag, did you set it correctly?`)
}
localName = toCamelCase(localName);

const attributeURI: URL = new URL(`${attributeBaseURI}${localName}`);
Expand Down

0 comments on commit 737bb3d

Please sign in to comment.