Fix search issues (#1484)

Fix search issues
This commit is contained in:
Abhinav Kumar 2023-12-04 17:42:47 +05:30 committed by GitHub
commit 729a5eef78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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 {