mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-22 15:15:19 +00:00
emit error event if manifest creation fails
This commit is contained in:
@@ -105,8 +105,15 @@ class Watcher extends EventEmitter {
|
|||||||
|
|
||||||
const dev_port = await ports.find(10000);
|
const dev_port = await ports.find(10000);
|
||||||
|
|
||||||
const routes = create_routes();
|
try {
|
||||||
create_main_manifests({ routes, dev_port });
|
const routes = create_routes();
|
||||||
|
create_main_manifests({ routes, dev_port });
|
||||||
|
} catch (err) {
|
||||||
|
this.emit('fatal', <events.FatalEvent>{
|
||||||
|
message: err.message
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.dev_server = new DevServer(dev_port);
|
this.dev_server = new DevServer(dev_port);
|
||||||
|
|
||||||
@@ -114,6 +121,15 @@ class Watcher extends EventEmitter {
|
|||||||
watch_files(locations.routes(), ['add', 'unlink'], () => {
|
watch_files(locations.routes(), ['add', 'unlink'], () => {
|
||||||
const routes = create_routes();
|
const routes = create_routes();
|
||||||
create_main_manifests({ routes, dev_port });
|
create_main_manifests({ routes, dev_port });
|
||||||
|
|
||||||
|
try {
|
||||||
|
const routes = create_routes();
|
||||||
|
create_main_manifests({ routes, dev_port });
|
||||||
|
} catch (err) {
|
||||||
|
this.emit('error', <events.ErrorEvent>{
|
||||||
|
message: err.message
|
||||||
|
});
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
watch_files(`${locations.app()}/template.html`, ['change'], () => {
|
watch_files(`${locations.app()}/template.html`, ['change'], () => {
|
||||||
@@ -272,7 +288,7 @@ class Watcher extends EventEmitter {
|
|||||||
if (this.closed) return;
|
if (this.closed) return;
|
||||||
this.closed = true;
|
this.closed = true;
|
||||||
|
|
||||||
this.dev_server.close();
|
if (this.dev_server) this.dev_server.close();
|
||||||
|
|
||||||
if (this.proc) this.proc.kill();
|
if (this.proc) this.proc.kill();
|
||||||
this.filewatchers.forEach(watcher => {
|
this.filewatchers.forEach(watcher => {
|
||||||
|
|||||||
Reference in New Issue
Block a user