mirror of
https://github.com/VERT-sh/VERT.git
synced 2026-02-21 15:28:30 -06:00
handle error when during initialization of vips
This commit is contained in:
@@ -43,7 +43,14 @@ export class VipsConverter extends Converter {
|
||||
this.worker.onmessage = (e) => {
|
||||
const message: WorkerMessage = e.data;
|
||||
log(["converters", this.name], `received message ${message.type}`);
|
||||
if (message.type === "loaded") this.ready = true;
|
||||
if (message.type === "loaded") {
|
||||
this.ready = true;
|
||||
} else if (message.type === "error") {
|
||||
error(["converters", this.name], `error in worker: ${message.error}`);
|
||||
throw new Error(message.error);
|
||||
} else {
|
||||
error(["converters", this.name], `unknown message type ${message.type}`);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user