mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fetch: proper error for unsupported protocol (#4085)
This commit is contained in:
parent
bf48f5fa5a
commit
e9fff02e96
3 changed files with 31 additions and 1 deletions
|
@ -9,6 +9,17 @@ import {
|
|||
fail
|
||||
} from "./test_util.ts";
|
||||
|
||||
testPerm({ net: true }, async function fetchProtocolError(): Promise<void> {
|
||||
let err;
|
||||
try {
|
||||
await fetch("file:///");
|
||||
} catch (err_) {
|
||||
err = err_;
|
||||
}
|
||||
assert(err instanceof TypeError);
|
||||
assertStrContains(err.message, "not supported");
|
||||
});
|
||||
|
||||
testPerm({ net: true }, async function fetchConnectionError(): Promise<void> {
|
||||
let err;
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue