Skip to content

Commit

Permalink
elaborate on panic msg for Binary/HexBinary
Browse files Browse the repository at this point in the history
  • Loading branch information
uint committed Apr 24, 2024
1 parent a6d9a11 commit cd75995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/std/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
}
}
Expand All @@ -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.")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/hex_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
}
}
Expand All @@ -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.")
}
}
}
Expand Down

0 comments on commit cd75995

Please sign in to comment.