refactor: reduce number of ErrorKind variants (#3662)

This commit is contained in:
Bartek Iwańczuk 2020-01-20 16:50:16 +01:00 committed by Ry Dahl
parent e83658138b
commit c90036ab88
13 changed files with 61 additions and 224 deletions

View file

@ -15,8 +15,8 @@ testPerm({ net: true }, async function fetchConnectionError(): Promise<void> {
} catch (err_) {
err = err_;
}
assertEquals(err.kind, Deno.ErrorKind.HttpOther);
assertEquals(err.name, "HttpOther");
assertEquals(err.kind, Deno.ErrorKind.Http);
assertEquals(err.name, "Http");
assertStrContains(err.message, "error trying to connect");
});
@ -106,8 +106,8 @@ testPerm({ net: true }, async function fetchEmptyInvalid(): Promise<void> {
} catch (err_) {
err = err_;
}
assertEquals(err.kind, Deno.ErrorKind.RelativeUrlWithoutBase);
assertEquals(err.name, "RelativeUrlWithoutBase");
assertEquals(err.kind, Deno.ErrorKind.UrlParse);
assertEquals(err.name, "UrlParse");
});
testPerm({ net: true }, async function fetchMultipartFormDataSuccess(): Promise<