This commit is contained in:
2026-01-05 21:37:06 +01:00
parent d9e6151ae0
commit 4a1bfa57a3
3 changed files with 53 additions and 2 deletions

View File

@@ -187,7 +187,7 @@ export class SeedDemoUsers {
passwordHash?: PasswordHash;
primaryDriverId?: string;
} = {
id: userId,
id: existingUser.getId().value,
displayName: spec.displayName,
email: spec.email,
passwordHash: PasswordHash.fromHash(passwordHash),

View File

@@ -39,7 +39,12 @@ export class BootstrapModule implements OnModuleInit {
// Seed demo users (only in dev/test, respects bootstrap enable flag)
if (await this.shouldSeedDemoUsers()) {
await this.seedDemoUsers.execute();
try {
await this.seedDemoUsers.execute();
} catch (error) {
this.logger.warn('[Bootstrap] Demo user seeding failed but continuing startup:', error);
console.warn('[Bootstrap] Demo user seeding failed but continuing startup:', error);
}
}
console.log('[Bootstrap] Application data initialized successfully');

View File

@@ -0,0 +1,46 @@
'use client';
import Link from 'next/link';
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<html lang="en">
<body className="antialiased">
<main className="min-h-screen flex items-center justify-center bg-deep-graphite text-white px-6">
<div className="max-w-md text-center space-y-4">
<h1 className="text-3xl font-semibold">Something went wrong</h1>
<p className="text-sm text-gray-400">
{error?.message ? error.message : 'An unexpected error occurred.'}
</p>
{error?.digest && (
<p className="text-xs text-gray-500 font-mono">
Error ID: {error.digest}
</p>
)}
<div className="flex items-center justify-center gap-3 pt-2">
<button
type="button"
onClick={() => reset()}
className="inline-flex items-center justify-center rounded-md bg-primary-blue px-4 py-2 text-sm font-medium text-white hover:bg-primary-blue/80 transition-colors"
>
Try again
</button>
<Link
href="/"
className="inline-flex items-center justify-center rounded-md bg-iron-gray px-4 py-2 text-sm font-medium text-white hover:bg-iron-gray/80 transition-colors"
>
Go home
</Link>
</div>
</div>
</main>
</body>
</html>
);
}