commit
0b0075c894
7 changed files with 56 additions and 4 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,5 +1,15 @@
|
|||
# CHANGELOG
|
||||
|
||||
## v1.6.53
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fixed watch folder disabled issue
|
||||
- Fixed BF Add on related issues
|
||||
- Fixed clip sync issue and added better logging
|
||||
- Fixed mov file upload
|
||||
- Fixed clip extraction related issue
|
||||
|
||||
## v1.6.52
|
||||
|
||||
### New Features
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "ente",
|
||||
"productName": "ente",
|
||||
"version": "1.6.52",
|
||||
"version": "1.6.53",
|
||||
"private": true,
|
||||
"description": "Desktop client for ente.io",
|
||||
"main": "app/main.js",
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { ipcRenderer } from 'electron';
|
||||
import { writeStream } from '../services/fs';
|
||||
import { isExecError } from '../utils/error';
|
||||
import { parseExecError } from '../utils/error';
|
||||
|
||||
export async function computeImageEmbedding(
|
||||
imageData: Uint8Array
|
||||
|
@ -14,6 +16,13 @@ export async function computeImageEmbedding(
|
|||
tempInputFilePath
|
||||
);
|
||||
return embedding;
|
||||
} catch (err) {
|
||||
if (isExecError(err)) {
|
||||
const parsedExecError = parseExecError(err);
|
||||
throw Error(parsedExecError);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
} finally {
|
||||
if (tempInputFilePath) {
|
||||
await ipcRenderer.invoke('remove-temp-file', tempInputFilePath);
|
||||
|
@ -24,6 +33,18 @@ export async function computeImageEmbedding(
|
|||
export async function computeTextEmbedding(
|
||||
text: string
|
||||
): Promise<Float32Array> {
|
||||
const embedding = await ipcRenderer.invoke('compute-text-embedding', text);
|
||||
return embedding;
|
||||
try {
|
||||
const embedding = await ipcRenderer.invoke(
|
||||
'compute-text-embedding',
|
||||
text
|
||||
);
|
||||
return embedding;
|
||||
} catch (err) {
|
||||
if (isExecError(err)) {
|
||||
const parsedExecError = parseExecError(err);
|
||||
throw Error(parsedExecError);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,4 +3,6 @@ export const CustomErrors = {
|
|||
'Windows native image processing is not supported',
|
||||
INVALID_OS: (os: string) => `Invalid OS - ${os}`,
|
||||
WAIT_TIME_EXCEEDED: 'Wait time exceeded',
|
||||
UNSUPPORTED_PLATFORM: (platform: string, arch: string) =>
|
||||
`Unsupported platform - ${platform} ${arch}`,
|
||||
};
|
||||
|
|
|
@ -165,6 +165,7 @@ export async function computeImageEmbedding(
|
|||
return embeddingArray;
|
||||
} catch (err) {
|
||||
logErrorSentry(err, 'Error in computeImageEmbedding');
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,5 +201,6 @@ export async function computeTextEmbedding(
|
|||
return embeddingArray;
|
||||
} catch (err) {
|
||||
logErrorSentry(err, 'Error in computeTextEmbedding');
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
|
17
src/utils/error.ts
Normal file
17
src/utils/error.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { CustomErrors } from '../constants/errors';
|
||||
|
||||
export const isExecError = (err: any) => {
|
||||
return err.message.includes('Command failed:');
|
||||
};
|
||||
|
||||
export const parseExecError = (err: any) => {
|
||||
const errMessage = err.message;
|
||||
if (errMessage.includes('Bad CPU type in executable')) {
|
||||
return CustomErrors.UNSUPPORTED_PLATFORM(
|
||||
process.platform,
|
||||
process.arch
|
||||
);
|
||||
} else {
|
||||
return errMessage;
|
||||
}
|
||||
};
|
2
ui
2
ui
|
@ -1 +1 @@
|
|||
Subproject commit 590c4d6a7f0a1f60256ddcac1a2f025a15561b53
|
||||
Subproject commit d757f7cc410cc916ae3c709827613486b83b6cb3
|
Loading…
Add table
Reference in a new issue