use std::str::Utf8Error;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum GCPluginABIError {
    #[error("Unsupported type {0}")]
    UnsuportedType(String),
    #[error("DatapointValue with unknown type={0}")]
    UnknownDatapointValue(u32),
    #[error("Error converting UTF-8 string")]
    ErrorConvertingString(#[from] Utf8Error),
    #[error("Callback function not available")]
    ErrorCallbackNotAvailable,
    #[error("Error Parsing JSON configuration")]
    ErrorParsingJsonConfig(#[from] serde_json::Error),
    #[error("Error serializing JSON configuration")]
    ErrorSerializingJsonConfig,
    #[error("Error, unknown log level {0}")]
    ErrorInvalidLogLevel(u32),
    #[error("Couldn't parse json query string: {0}")]
    ErrorParsingJsonStringQuery(String),
    #[error("Error parsing json: {0}")]
    ErrorParsingWithJsonQueryEngine(String),
}