diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-16 09:24:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-16 09:27:49 +0200 |
commit | 0d6a8289fb5ce7466f74a0514b3a6e620bfa2e59 (patch) | |
tree | 1a31b31352e633da620ab4510e8c3bbafeb15a4f /packages/peertube-runner/shared | |
parent | 287057050526e1f474c4f4d5d9a7ef3b7c677f2f (diff) | |
download | PeerTube-0d6a8289fb5ce7466f74a0514b3a6e620bfa2e59.tar.gz PeerTube-0d6a8289fb5ce7466f74a0514b3a6e620bfa2e59.tar.zst PeerTube-0d6a8289fb5ce7466f74a0514b3a6e620bfa2e59.zip |
Better runner error UX when server is not run
Diffstat (limited to 'packages/peertube-runner/shared')
-rw-r--r-- | packages/peertube-runner/shared/ipc/ipc-client.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/peertube-runner/shared/ipc/ipc-client.ts b/packages/peertube-runner/shared/ipc/ipc-client.ts index 7f5951157..db8d7f1bf 100644 --- a/packages/peertube-runner/shared/ipc/ipc-client.ts +++ b/packages/peertube-runner/shared/ipc/ipc-client.ts | |||
@@ -11,8 +11,21 @@ export class IPCClient { | |||
11 | await ensureDir(ConfigManager.Instance.getSocketDirectory()) | 11 | await ensureDir(ConfigManager.Instance.getSocketDirectory()) |
12 | 12 | ||
13 | const socketPath = ConfigManager.Instance.getSocketPath() | 13 | const socketPath = ConfigManager.Instance.getSocketPath() |
14 | |||
14 | this.netIPC = new NetIPC({ path: socketPath }) | 15 | this.netIPC = new NetIPC({ path: socketPath }) |
15 | await this.netIPC.connect() | 16 | |
17 | try { | ||
18 | await this.netIPC.connect() | ||
19 | } catch (err) { | ||
20 | if (err.code === 'ECONNREFUSED') { | ||
21 | throw new Error( | ||
22 | 'This runner is not currently running in server mode on this system. ' + | ||
23 | 'Please run it using the `server` command first (in another terminal for example) and then retry your command.' | ||
24 | ) | ||
25 | } | ||
26 | |||
27 | throw err | ||
28 | } | ||
16 | } | 29 | } |
17 | 30 | ||
18 | async askRegister (options: { | 31 | async askRegister (options: { |