0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(cli): deno doc panics on invalid url (#11536)

This commit is contained in:
Feng Yu 2021-07-29 19:07:25 +08:00 committed by GitHub
parent 4641aacba6
commit 935083d99a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,4 @@
error: invalid URL: invalid domain character
Caused by:
invalid domain character

View file

@ -43,3 +43,9 @@ itest!(deno_doc_types_header_direct {
output: "doc/types_header.out",
http_server: true,
});
itest!(deno_doc_invalid_url {
args: "doc https://raw.githubusercontent.com%2Fdyedgreen%2Fdeno-sqlite%2Frework_api%2Fmod.ts",
output: "doc/invalid_url.out",
exit_code: 1,
});

View file

@ -98,7 +98,7 @@ pub async fn print_docs(
get_types(flags.unstable).as_str(),
)
} else {
let module_specifier = resolve_url_or_path(&source_file).unwrap();
let module_specifier = resolve_url_or_path(&source_file)?;
// If the root module has external types, the module graph won't redirect it,
// so instead create a dummy file which exports everything from the actual file being documented.