Improve search functionality with better error handling and form submission
This commit is contained in:
1 parent
6ab3254384
commit
e5ce8e4783
2 files changed
+24
-6
No files matched your search
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user