]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - packages/peertube-runner/shared/ipc/ipc-client.ts
End runner live transcoding on update error
[github/Chocobozzz/PeerTube.git] / packages / peertube-runner / shared / ipc / ipc-client.ts
index 7f595115783c5347950bdcc74e379e85b6c31603..db8d7f1bf6c4e405ca48fae43cb24d2697a73dc8 100644 (file)
@@ -11,8 +11,21 @@ export class IPCClient {
     await ensureDir(ConfigManager.Instance.getSocketDirectory())
 
     const socketPath = ConfigManager.Instance.getSocketPath()
+
     this.netIPC = new NetIPC({ path: socketPath })
-    await this.netIPC.connect()
+
+    try {
+      await this.netIPC.connect()
+    } catch (err) {
+      if (err.code === 'ECONNREFUSED') {
+        throw new Error(
+          'This runner is not currently running in server mode on this system. ' +
+          'Please run it using the `server` command first (in another terminal for example) and then retry your command.'
+        )
+      }
+
+      throw err
+    }
   }
 
   async askRegister (options: {