summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-03-18 20:53:31 +0530
committerGitHub <noreply@github.com>2022-03-18 20:53:31 +0530
commit2799b0b7b4bd7a0f1a8390cb7960d9fdf2bb6d5e (patch)
tree4b4f3b83bf9bd0205e24344d9dab9cae2a90da22
parent9c403f146e801bed741d9d66aaa415ff607cb657 (diff)
chore(ops): include argument position in serde_v8 errors (#14027)
-rw-r--r--cli/tests/testdata/workers/test.ts2
-rw-r--r--ops/lib.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/cli/tests/testdata/workers/test.ts b/cli/tests/testdata/workers/test.ts
index bb9d56fe0..b9204adee 100644
--- a/cli/tests/testdata/workers/test.ts
+++ b/cli/tests/testdata/workers/test.ts
@@ -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[]',
);
});
diff --git a/ops/lib.rs b/ops/lib.rs
index 608219a1c..49057507d 100644
--- a/ops/lib.rs
+++ b/ops/lib.rs
@@ -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);
}
};