frontend-app-api: add collection of route binding errors

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-09-15 16:55:32 +02:00
parent c89e954bf4
commit d89815ce9f
8 changed files with 220 additions and 67 deletions
@@ -28,9 +28,10 @@ const DEFAULT_WARNING_CODES: Array<keyof AppErrorTypes> = [
function AppErrorItem(props: { error: AppError }): JSX.Element {
const { context } = props.error;
const extensionId =
'extensionId' in context ? context.extensionId : context.node.spec.id;
const node = 'node' in context ? context.node : undefined;
const extensionId =
'extensionId' in context ? context.extensionId : node?.spec.id;
const routeId = 'routeId' in context ? context.routeId : undefined;
const plugin = 'plugin' in context ? context.plugin : node?.spec.plugin;
const pluginId = plugin?.id ?? 'N/A';
@@ -46,7 +47,8 @@ function AppErrorItem(props: { error: AppError }): JSX.Element {
<div>
<b>{props.error.code}</b>: {props.error.message}
<pre style={{ marginLeft: '1rem' }}>
<div>extensionId: {extensionId}</div>
{extensionId && <div>extensionId: {extensionId}</div>}
{routeId && <div>routeId: {routeId}</div>}
{pluginId && <div>pluginId: {pluginId}</div>}
{info && (
<div>