diff options
Diffstat (limited to 'ops/lib.rs')
-rw-r--r-- | ops/lib.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ops/lib.rs b/ops/lib.rs index 49057507d..4a24b6e33 100644 --- a/ops/lib.rs +++ b/ops/lib.rs @@ -260,8 +260,13 @@ fn codegen_sync_ret( quote! {} } else { quote! { - let ret = #core::serde_v8::to_v8(scope, v).unwrap(); - rv.set(ret); + match #core::serde_v8::to_v8(scope, v) { + Ok(ret) => rv.set(ret), + Err(err) => #core::_ops::throw_type_error( + scope, + format!("Error serializing return: {}", #core::anyhow::Error::from(err)), + ), + }; } }; |