change fatal events to be clonable, for IPC purposes

This commit is contained in:
Rich Harris
2018-06-16 13:49:19 -04:00
parent 8240595d70
commit f0d7a1aaab
2 changed files with 3 additions and 3 deletions

View File

@@ -90,7 +90,7 @@ class Watcher extends EventEmitter {
if (this.port) {
if (!await ports.check(this.port)) {
this.emit('fatal', <events.FatalEvent>{
error: new Error(`Port ${this.port} is unavailable`)
message: `Port ${this.port} is unavailable`
});
return;
}

View File

@@ -7,11 +7,11 @@ export type ReadyEvent = {
export type ErrorEvent = {
type: string;
error: Error;
message: string;
};
export type FatalEvent = {
error: Error;
message: string;
};
export type InvalidEvent = {