mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-27 01:46:35 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
10f5cf7fac
commit
01fcb66402
1 changed files with 6 additions and 2 deletions
|
|
@ -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" } });
|
||||
|
|
|
|||
Loading…
Reference in a new issue