diff --git a/render/src/nestedMenu/src/loadNestedMenu.service.ts b/render/src/nestedMenu/src/loadNestedMenu.service.ts index cb1eec7..5f99cf9 100644 --- a/render/src/nestedMenu/src/loadNestedMenu.service.ts +++ b/render/src/nestedMenu/src/loadNestedMenu.service.ts @@ -9,11 +9,16 @@ export async function loadNestedMenu(content:string):Promise{ initNestedMenu(nestedMenu) return content.replace(menuRe, '
') } catch (e: any) { + const nestErrMsg = (content?: string) => ` +
+

Nested Menu Syntax Error

+ ${content ? content : ''} +
+ ` if ('message' in e) { - return content.replace(menuRe, `
There was an error with the nested menu syntax:\n${e.message}
`) + return content.replace(menuRe, nestErrMsg(e.message)) } else { - return content.replace(menuRe, '
There was an error parsing the nested menu syntax
') + return content.replace(menuRe, nestErrMsg()) } - } } \ No newline at end of file