From 04a7c08a20f3a8964cbcf4c212cbe42646462eb3 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 26 Oct 2020 11:02:22 -0700 Subject: [PATCH] Fix typos --- ui/store.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/store.ts b/ui/store.ts index fa2ee4e..82bb02f 100644 --- a/ui/store.ts +++ b/ui/store.ts @@ -177,7 +177,7 @@ export async function xhrRequest( const err = new Error(); err["message"] = xhr.status === 0 - ? "Server is unrachable" + ? "Server is unreachable" : `Unexpected response status code ${xhr.status}`; err["code"] = xhr.status; err["response"] = xhr.responseText; @@ -388,7 +388,7 @@ function _fulfill( extract: (xhr) => { if (xhr.status === 403) throw new Error("Not authorized"); if (!xhr.status) { - throw new Error("Server is unrachable"); + throw new Error("Server is unreachable"); } else if (xhr.status !== 200) { throw new Error( `Unexpected response status code ${xhr.status}` @@ -608,6 +608,7 @@ export function postTasks( body: tasks, extract: (xhr) => { if (xhr.status === 403) throw new Error("Not authorized"); + if (!xhr.status) throw new Error("Server is unreachable"); if (xhr.status !== 200) throw new Error(xhr.response); const connectionRequestStatus = xhr.getResponseHeader( "Connection-Request" @@ -679,7 +680,7 @@ export function resourceExists(resource: string, id: string): Promise { }), extract: (xhr) => { if (xhr.status === 403) throw new Error("Not authorized"); - if (!xhr.status) throw new Error("Server is unrachable"); + if (!xhr.status) throw new Error("Server is unreachable"); else if (xhr.status !== 200) throw new Error(`Unexpected response status code ${xhr.status}`); return +xhr.getResponseHeader("x-total-count");