summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-05-22 11:06:26 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-05-22 11:06:26 -0300
commitf94fef169b1c1e683af1e4b1528bb386de052567 (patch)
tree9ddd3ebaa512a0bac841189b9242ae717a229fb2
parentde3bb7eb3ec7ce2a9498ca4f07ee84e52a577ad8 (diff)
parent88b82075d6eb80dea15f0805cd8211b5373cca66 (diff)
downloadmullvadvpn-f94fef169b1c1e683af1e4b1528bb386de052567.tar.xz
mullvadvpn-f94fef169b1c1e683af1e4b1528bb386de052567.zip
Merge branch 'no-daemon-error-message'
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/lib/backend.js10
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 568865b62f..77e3257548 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -66,6 +66,7 @@ Line wrap the file at 100 chars. Th
- Fix OpenVPN warning about usage of AES-256-CBC cipher.
- Fix "Out of time" screen status icon position.
- If necessary, create parent directories for RPC connection info file and tunnel log.
+- Fix error message when attempting to login when the daemon isn't running .
## [2018.1] - 2018-03-01
diff --git a/app/lib/backend.js b/app/lib/backend.js
index 4df4d801e8..27b4b2c927 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -11,7 +11,7 @@ import type { ReduxStore } from '../redux/store';
import type { AccountToken, BackendState, RelaySettingsUpdate } from './ipc-facade';
import type { ConnectionState } from '../redux/connection/reducers';
-export type ErrorType = 'NO_CREDIT' | 'NO_INTERNET' | 'INVALID_ACCOUNT' | 'NO_ACCOUNT' | 'COMMUNICATION_FAILURE' | 'UNKNOWN_ERROR' ;
+export type ErrorType = 'NO_CREDIT' | 'NO_INTERNET' | 'NO_DAEMON' | 'INVALID_ACCOUNT' | 'NO_ACCOUNT' | 'COMMUNICATION_FAILURE' | 'UNKNOWN_ERROR' ;
export class BackendError extends Error {
type: ErrorType;
@@ -51,6 +51,8 @@ export class BackendError extends Error {
return 'Invalid account number';
case 'NO_ACCOUNT':
return 'No account was set';
+ case 'NO_DAEMON':
+ return 'Could not connect to the Mullvad daemon';
case 'COMMUNICATION_FAILURE':
return 'api.mullvad.net is blocked, please check your firewall';
case 'UNKNOWN_ERROR': {
@@ -194,6 +196,10 @@ export class Backend {
}
_rpcErrorToBackendError(e) {
+ if (e instanceof BackendError) {
+ return e;
+ }
+
const isJsonRpcError = e.hasOwnProperty('code');
if (isJsonRpcError) {
switch(e.code) {
@@ -525,7 +531,7 @@ export class Backend {
}
return this._authenticationPromise;
} else {
- return Promise.reject(new Error('Missing authentication credentials.'));
+ return Promise.reject(new BackendError('NO_DAEMON'));
}
}