better error
This commit is contained in:
parent
b32aece47f
commit
fdef4b8482
|
@ -1,5 +1,5 @@
|
|||
export const CustomErrors = {
|
||||
WINDOWS_NATIVE_IMAGE_PROCESSING_NOT_SUPPORTED:
|
||||
'Windows native image processing is not supported',
|
||||
INVALID_OS: 'Invalid OS',
|
||||
INVALID_OS: (os: string) => `Invalid OS - ${os}`,
|
||||
};
|
||||
|
|
|
@ -161,7 +161,7 @@ function constructConvertCommand(
|
|||
}
|
||||
);
|
||||
} else {
|
||||
throw Error(CustomErrors.INVALID_OS);
|
||||
throw Error(CustomErrors.INVALID_OS(process.platform));
|
||||
}
|
||||
return convertCmd;
|
||||
}
|
||||
|
@ -278,9 +278,7 @@ function constructThumbnailGenerationCommand(
|
|||
return cmdPart;
|
||||
});
|
||||
} else {
|
||||
throw Error(
|
||||
`${process.platform} native thumbnail generation not supported yet`
|
||||
);
|
||||
throw Error(CustomErrors.INVALID_OS(process.platform));
|
||||
}
|
||||
return thumbnailGenerationCmd;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue