1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -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 Kitson Kelly
parent 7d853ff33b
commit 3a106f08d8
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);
}
};