diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-04-27 02:12:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 02:12:39 +0200 |
commit | 1054723a4b8bcbfe904980acd2193c0fb2458001 (patch) | |
tree | 68601f834a64b08fc7e1a6428fa3c11c6c329f26 /serde_v8/magic/bigint.rs | |
parent | 09b6dbc0a63cc55d0f65bd51416a04e577e08490 (diff) |
feat(serde_v8): better error output (#18815)
The type that was received is now printed as part of a message.
Diffstat (limited to 'serde_v8/magic/bigint.rs')
-rw-r--r-- | serde_v8/magic/bigint.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/serde_v8/magic/bigint.rs b/serde_v8/magic/bigint.rs index 69828747f..330803daf 100644 --- a/serde_v8/magic/bigint.rs +++ b/serde_v8/magic/bigint.rs @@ -5,6 +5,7 @@ use smallvec::SmallVec; use super::transl8::FromV8; use super::transl8::ToV8; +use crate::error::value_to_type_str; use crate::magic::transl8::impl_magic; use crate::Error; @@ -42,7 +43,7 @@ impl FromV8 for BigInt { value: v8::Local<v8::Value>, ) -> Result<Self, crate::Error> { let v8bigint = v8::Local::<v8::BigInt>::try_from(value) - .map_err(|_| Error::ExpectedBigInt)?; + .map_err(|_| Error::ExpectedBigInt(value_to_type_str(value)))?; let word_count = v8bigint.word_count(); let mut words: SmallVec<[u64; 1]> = smallvec![0u64; word_count]; let (sign_bit, _words) = v8bigint.to_words_array(&mut words); |