From 01fcb6640239b1883cf97349820481a23f3a594d Mon Sep 17 00:00:00 2001 From: Mitchell R Date: Wed, 27 May 2026 02:41:13 +0200 Subject: [PATCH] fix: surface AbleSign screen creation errors instead of swallowing Previously caught and silently ignored. Now shows error message on the screens page so we can debug the pairing flow. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/src/plugins/service-admin-http/routes-ablesign.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/plugins/service-admin-http/routes-ablesign.ts b/server/src/plugins/service-admin-http/routes-ablesign.ts index 92f7d00..1733e89 100644 --- a/server/src/plugins/service-admin-http/routes-ablesign.ts +++ b/server/src/plugins/service-admin-http/routes-ablesign.ts @@ -144,8 +144,12 @@ export function registerAbleSignRoutes(app: H3, deps: AdminDeps): void { await deps.repo.updateAbleSignAccount(accountId, { screen_count: (account.screen_count ?? 0) + 1, }); - } catch { - // redirect back — error handling TODO + } catch (err) { + const msg = (err as Error).message ?? "unknown error"; + event.context.obs?.log.warn("ablesign screen creation failed: {msg}", { msg }); + const screens = await deps.repo.listAbleSignScreens(accountId); + for (const s of screens) (s as any).has_entity = !!(await deps.repo.getEntityByAbleSignScreen(s.id)); + return htmlPage(AbleSignScreensPage({ screens, accountId, error: `Screen creation failed: ${msg}` })); } return new Response(null, { status: 302, headers: { location: "/admin/ablesign/screens" } });