Improve search functionality with better error handling and form submission

This commit is contained in:
spaghet committed 2025-08-22 12:50:17 -04:00
1 parent 6ab3254384
commit e5ce8e4783
2 files changed
+24 -6

No files matched your search

+5 -1
View File
@@ -338,7 +338,11 @@ export async function searchContent(query: string): Promise<{ posts: BlogPost[],
};
} catch (error) {
console.error("Error performing search:", error);
throw new Error("Failed to perform search");
// More specific error handling for Appwrite errors
if (error instanceof Error) {
throw new Error(`Search failed: ${error.message}`);
}
throw new Error("Search failed due to an unknown error");
}
}