fix: improve error handling for user settings retrieval in GET and settings store

This commit is contained in:
Linus Rath
2026-03-24 14:20:10 +01:00
parent e07365b066
commit d666bddbc4
2 changed files with 6 additions and 5 deletions
+1 -4
View File
@@ -53,10 +53,7 @@ export async function GET(request: NextRequest) {
try {
const settings = await loadUserSettings(username, serverUrl);
if (!settings) {
return NextResponse.json({ error: 'No settings found' }, { status: 404 });
}
return NextResponse.json({ settings });
return NextResponse.json({ settings: settings || null });
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
const code = (error as NodeJS.ErrnoException).code;