Fix error in worker (#540)

This commit is contained in:
jeromewu 2023-08-10 22:02:08 +08:00 committed by GitHub
parent d12b605536
commit 2fc2edd476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,7 +177,11 @@ self.onmessage = async ({
throw ERROR_UNKNOWN_MESSAGE_TYPE; throw ERROR_UNKNOWN_MESSAGE_TYPE;
} }
} catch (e) { } catch (e) {
self.postMessage({ id, type: FFMessageType.ERROR, data: e as Error }); self.postMessage({
id,
type: FFMessageType.ERROR,
data: (e as Error).toString(),
});
return; return;
} }
if (data instanceof Uint8Array) { if (data instanceof Uint8Array) {