Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

ignore logging for SKIPPING_CLIP_SEARCH_REQUEST error

Abhinavedce6f66f00e
diff --git a/apps/photos/src/services/searchService.ts b/apps/photos/src/services/searchService.ts
index bba89d1d6d..fed967b04a 100644
--- a/apps/photos/src/services/searchService.ts
+++ b/apps/photos/src/services/searchService.ts
@@ -32,6 +32,7 @@ import {
computeClipMatchScore,
getLocalClipImageEmbeddings,
} from './clipService';
+import { CustomError } from '@ente/shared/error';
const DIGITS = new Set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']);
@@ -302,7 +303,9 @@ async function getClipSuggestion(searchPhrase: string): Promise<Suggestion> {
label: searchPhrase,
};
} catch (e) {
- logError(e, 'getClipSuggestion failed');
+ if (!e.message?.includes(CustomError.MODEL_DOWNLOAD_PENDING)) {
+ logError(e, 'getClipSuggestion failed');
+ }
return null;
}
}
diff --git a/packages/shared/error/index.ts b/packages/shared/error/index.ts
index cdeef73283..68fa970641 100644
--- a/packages/shared/error/index.ts
+++ b/packages/shared/error/index.ts
@@ -86,6 +86,8 @@ export const CustomError = {
ServerError: 'server error',
FILE_NOT_FOUND: 'file not found',
UNSUPPORTED_PLATFORM: 'Unsupported platform',
+ MODEL_DOWNLOAD_PENDING:
+ 'Model download pending, skipping clip search request',
};
export function handleUploadError(error: any): Error {