Fix typos
This commit is contained in:
1 parent
92091b52a2
commit
04a7c08a20
1 file changed
+4
-3
+4
-3
@@ -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<number> {
|
||||
}),
|
||||
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");
|
||||
|
||||
Reference in new issue
Block a user