feat: add error handling to search functions

This commit is contained in:
2026-06-16 14:00:41 +02:00
committed by Milas Holsting
parent 2a8294c405
commit 2ec1cdec38
3 changed files with 8 additions and 4 deletions

View File

@@ -177,7 +177,8 @@ export const isSafeImageUrl = (rawUrl?: string): boolean => {
try {
const parsed = new URL(rawUrl, window.location.origin);
return parsed.protocol === "https:" || parsed.protocol === "http:";
} catch {
} catch (error) {
console.error("Failed to validate URL:", error);
return false;
}
};