The handler adds its own error message prefix

Error occurred in handler for 'generateImageThumbnail': Error: This feature in not available on the current OS/arch
This commit is contained in:
Manav Rathi 2024-05-01 14:01:05 +05:30
parent 5ffc2f20fd
commit 52909f6f21
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -1021,7 +1021,7 @@ const withThumbnail = async (
fileTypeInfo,
);
} catch (e) {
if (e.message == CustomErrorMessage.NotAvailable) {
if (e.message.endsWith(CustomErrorMessage.NotAvailable)) {
moduleState.isNativeImageThumbnailGenerationNotAvailable = true;
} else {
log.error("Native thumbnail generation failed", e);

View file

@ -319,7 +319,7 @@ export const getRenderableImage = async (fileName: string, imageBlob: Blob) => {
try {
return await nativeConvertToJPEG(imageBlob);
} catch (e) {
if (e.message == CustomErrorMessage.NotAvailable) {
if (e.message.endsWith(CustomErrorMessage.NotAvailable)) {
moduleState.isNativeJPEGConversionNotAvailable = true;
} else {
log.error("Native conversion to JPEG failed", e);