use qubit_datatype::DataType;
use thiserror::Error;
#[derive(Debug, Clone, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum ValueWireEncodeError {
#[error("V1 JSON wire cannot represent a non-finite {data_type} value")]
NonFiniteFloat {
data_type: DataType,
},
#[error(
"V1 JSON wire cannot represent decimal scale {scale}; maximum absolute scale is {maximum_absolute_scale}"
)]
BigDecimalScaleTooLarge {
scale: i64,
maximum_absolute_scale: i64,
},
#[cfg(feature = "json")]
#[error(
"V1 JSON wire cannot represent an object containing the reserved key '{key}'"
)]
ReservedJsonObjectKey {
key: &'static str,
},
}