diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-09-04 08:51:56 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-09-04 16:31:57 +0200 |
| commit | 451664f22cade702f06b7bb6e3dc29caf805d361 (patch) | |
| tree | 2969c10c12f56130b7312af4855994b67c3c7983 /gui | |
| parent | f6ac6a55ea8aafc8541a77ee93e69bc1ca9e57cf (diff) | |
| download | mullvadvpn-451664f22cade702f06b7bb6e3dc29caf805d361.tar.xz mullvadvpn-451664f22cade702f06b7bb6e3dc29caf805d361.zip | |
Make not finding a suitable relay block the network
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/packages/desktop/src/renderer/errors.js | 6 | ||||
| -rw-r--r-- | gui/packages/desktop/src/renderer/lib/daemon-rpc.js | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gui/packages/desktop/src/renderer/errors.js b/gui/packages/desktop/src/renderer/errors.js index ddf0c239bb..b333f66221 100644 --- a/gui/packages/desktop/src/renderer/errors.js +++ b/gui/packages/desktop/src/renderer/errors.js @@ -11,6 +11,12 @@ export class BlockedError extends Error { case 'start_tunnel_error': super('Failed to start tunnel connection'); break; + case 'no_matching_relay': + super('No relay server matches the current settings'); + break; + case 'no_account_token': + super('No account token configured'); + break; default: super(`Unknown error: ${(reason: empty)}`); } diff --git a/gui/packages/desktop/src/renderer/lib/daemon-rpc.js b/gui/packages/desktop/src/renderer/lib/daemon-rpc.js index ae2e501268..0408017d5a 100644 --- a/gui/packages/desktop/src/renderer/lib/daemon-rpc.js +++ b/gui/packages/desktop/src/renderer/lib/daemon-rpc.js @@ -41,7 +41,11 @@ const LocationSchema = object({ mullvad_exit_ip: boolean, }); -export type BlockReason = 'set_security_policy_error' | 'start_tunnel_error'; +export type BlockReason = + | 'set_security_policy_error' + | 'start_tunnel_error' + | 'no_matching_relay' + | 'no_account_token'; export type DisconnectedState = { state: 'disconnected', }; @@ -218,7 +222,12 @@ const AccountDataSchema = object({ expiry: string, }); -const allBlockReasons: Array<BlockReason> = ['set_security_policy_error', 'start_tunnel_error']; +const allBlockReasons: Array<BlockReason> = [ + 'set_security_policy_error', + 'start_tunnel_error', + 'no_matching_relay', + 'no_account_token', +]; const BlockedStateSchema = object({ state: enumeration('blocked'), details: enumeration(...allBlockReasons), |
