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:
parent
4641aacba6
commit
935083d99a
3 changed files with 11 additions and 1 deletions
4
cli/tests/doc/invalid_url.out
Normal file
4
cli/tests/doc/invalid_url.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
error: invalid URL: invalid domain character
|
||||
|
||||
Caused by:
|
||||
invalid domain character
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue