diff options
Diffstat (limited to 'serde_v8/magic/u16string.rs')
-rw-r--r-- | serde_v8/magic/u16string.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/serde_v8/magic/u16string.rs b/serde_v8/magic/u16string.rs index 57e3fd0f6..04d742da9 100644 --- a/serde_v8/magic/u16string.rs +++ b/serde_v8/magic/u16string.rs @@ -1,5 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +use crate::error::value_to_type_str; use crate::Error; use super::transl8::impl_magic; @@ -37,7 +38,7 @@ impl FromV8 for U16String { value: v8::Local<v8::Value>, ) -> Result<Self, crate::Error> { let v8str = v8::Local::<v8::String>::try_from(value) - .map_err(|_| Error::ExpectedString)?; + .map_err(|_| Error::ExpectedString(value_to_type_str(value)))?; let len = v8str.length(); let mut buffer = Vec::with_capacity(len); #[allow(clippy::uninit_vec)] |