+use crate::HLQueryError::A2SError;
+
+#[derive(Debug)]
+enum HLQueryError {
+ A2SError(a2s::errors::Error)
+}
+
+impl Display for HLQueryError {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ match self {
+ A2SError(e) => write!(f, "{}", e)
+ }
+ }
+}
+
+impl Error for HLQueryError {}
+
+impl Serialize for HLQueryError {
+ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+ where
+ S: Serializer,
+ {
+ serializer.serialize_str(&format!("{self}"))
+ }
+}
+
+impl From<a2s::errors::Error> for HLQueryError {
+ fn from(e: a2s::errors::Error) -> Self {
+ Self::A2SError(e)
+ }
+}
+