summaryrefslogtreecommitdiffhomepage
path: root/app/errors.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-07-03 14:51:52 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-07-05 16:01:47 +0200
commita26471139d547bbcdcf07834480bb3f7b8477508 (patch)
treeb245396a33abdaeca0d5493ef6e494a32762866f /app/errors.js
parente288920bec3000b6cb0da7e16b95c27e4e34be6c (diff)
downloadmullvadvpn-a26471139d547bbcdcf07834480bb3f7b8477508.tar.xz
mullvadvpn-a26471139d547bbcdcf07834480bb3f7b8477508.zip
Replace Backend with AppRenderer
Diffstat (limited to 'app/errors.js')
-rw-r--r--app/errors.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/app/errors.js b/app/errors.js
new file mode 100644
index 0000000000..929fa52ab9
--- /dev/null
+++ b/app/errors.js
@@ -0,0 +1,61 @@
+export class NoCreditError extends Error {
+ constructor() {
+ super("Account doesn't have enough credit available for connection");
+ }
+
+ get userFriendlyTitle(): string {
+ return 'Out of time';
+ }
+
+ get userFriendlyMessage(): string {
+ return 'Buy more time, so you can continue using the internet securely';
+ }
+}
+
+export class NoInternetError extends Error {
+ constructor() {
+ super('Internet connectivity is currently unavailable');
+ }
+
+ get userFriendlyTitle(): string {
+ return 'Offline';
+ }
+
+ get userFriendlyMessage(): string {
+ return 'Your internet connection will be secured when you get back online';
+ }
+}
+
+export class NoDaemonError extends Error {
+ constructor() {
+ super('Could not connect to Mullvad daemon');
+ }
+}
+
+export class InvalidAccountError extends Error {
+ constructor() {
+ super('Invalid account number');
+ }
+}
+
+export class NoAccountError extends Error {
+ constructor() {
+ super('No account was set');
+ }
+}
+
+export class CommunicationError extends Error {
+ constructor() {
+ super('api.mullvad.net is blocked, please check your firewall');
+ }
+}
+
+export class UnknownError extends Error {
+ constructor(cause: string) {
+ super(`An unknown error occurred, ${cause}`);
+ }
+
+ get userFriendlyTitle(): string {
+ return 'Something went wrong';
+ }
+}