Address code review: add error logging, fix type cast, improve error messages

Co-authored-by: rfc1437 <774975+rfc1437@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-26 21:57:16 +00:00
parent 2aa23f2dd1
commit fda97c0977
3 changed files with 9 additions and 6 deletions

View File

@@ -183,8 +183,9 @@ export async function renderMacro(
if (pythonInfo) {
return await pythonMacroRendererFn(pythonInfo, macro.params, context);
}
} catch {
return `<span class="macro-error" title="Python macro error">${macro.rawText}</span>`;
} catch (error) {
const errorMessage = error instanceof Error ? error.message : 'Python macro error';
return `<span class="macro-error" title="${errorMessage}">${macro.rawText}</span>`;
}
}