From 133a05687d93d858960c7b14b6d48bfdfbbf2136 Mon Sep 17 00:00:00 2001 From: Shivansh Bagai Date: Mon, 4 Aug 2025 16:35:51 +0530 Subject: [PATCH] fixed issue #50 --- lib/metamodelutil.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/metamodelutil.js b/lib/metamodelutil.js index e7102e4..140f647 100644 --- a/lib/metamodelutil.js +++ b/lib/metamodelutil.js @@ -112,9 +112,20 @@ function createNameTable(priorModels, metaModel) { * @param {object} table - the name table * @return {string} the namespace for that name */ +// errors/NameNotFoundException.js +import { BaseException } from 'concerto-core'; + +export class NameNotFoundException extends BaseException { + constructor(name) { + super(`Name "${name}" not found`); + this.name = 'NameNotFoundException'; + this.missingName = name; + } +} + function resolveName(name, table) { if (!table[name]) { - throw new Error(`Name ${name} not found`); + throw new NameNotFoundException(name); } return table[name].namespace; }