1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore(ops): include argument position in serde_v8 errors (#14027)

This commit is contained in:
Divy Srivastava 2022-03-18 20:53:31 +05:30 committed by GitHub
parent 9c403f146e
commit 2799b0b7b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -593,7 +593,7 @@ Deno.test("Worker with invalid permission arg", function () {
deno: { permissions: { env: "foo" } },
}),
TypeError,
'Error parsing args: (deno.permissions.env) invalid value: string "foo", expected "inherit" or boolean or string[]',
'Error parsing args at position 1: (deno.permissions.env) invalid value: string "foo", expected "inherit" or boolean or string[]',
);
});

View file

@ -237,7 +237,7 @@ fn codegen_arg(
let #ident = match #core::serde_v8::from_v8(scope, #ident) {
Ok(v) => v,
Err(err) => {
let msg = format!("Error parsing args: {}", #core::anyhow::Error::from(err));
let msg = format!("Error parsing args at position {}: {}", #idx, #core::anyhow::Error::from(err));
return #core::_ops::throw_type_error(scope, msg);
}
};