From cd759953bb29898215922254ed7fd304d923ed2a Mon Sep 17 00:00:00 2001 From: Tomasz Kurcz Date: Wed, 24 Apr 2024 14:47:09 +0200 Subject: [PATCH] elaborate on panic msg for Binary/HexBinary --- packages/std/src/binary.rs | 4 ++-- packages/std/src/hex_binary.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/std/src/binary.rs b/packages/std/src/binary.rs index 061bd829aa..7b87800f02 100644 --- a/packages/std/src/binary.rs +++ b/packages/std/src/binary.rs @@ -217,7 +217,7 @@ impl Serialize for Binary { if serializer.is_human_readable() { serializer.serialize_str(&self.to_base64()) } else { - panic!("Binary is only intended to be used with JSON serialization for now") + panic!("Binary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.") } } } @@ -231,7 +231,7 @@ impl<'de> Deserialize<'de> for Binary { if deserializer.is_human_readable() { deserializer.deserialize_str(Base64Visitor) } else { - panic!("Binary is only intended to be used with JSON serialization for now") + panic!("Binary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.") } } } diff --git a/packages/std/src/hex_binary.rs b/packages/std/src/hex_binary.rs index 1f31ca14dd..d4145e025a 100644 --- a/packages/std/src/hex_binary.rs +++ b/packages/std/src/hex_binary.rs @@ -212,7 +212,7 @@ impl Serialize for HexBinary { if serializer.is_human_readable() { serializer.serialize_str(&self.to_hex()) } else { - panic!("HexBinary is only intended to be used with JSON serialization for now") + panic!("HexBinary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.") } } } @@ -226,7 +226,7 @@ impl<'de> Deserialize<'de> for HexBinary { if deserializer.is_human_readable() { deserializer.deserialize_str(HexVisitor) } else { - panic!("HexBinary is only intended to be used with JSON serialization for now") + panic!("HexBinary is only intended to be used with JSON serialization for now. If you are hitting this panic please open an issue at https://github.com/CosmWasm/cosmwasm describing your use case.") } } }