use fluvio_protocol::{Encoder, Decoder};
#[repr(i32)]
#[derive(thiserror::Error, Debug, Clone, Eq, PartialEq, Encoder, Default, Decoder)]
#[non_exhaustive]
#[fluvio(encode_discriminant)]
pub enum SmartModuleTransformErrorStatus {
#[error("encountered unknown error during SmartModule processing")]
#[default]
UnknownError = -1,
#[error("failed to decode SmartModule base input")]
DecodingBaseInput = -11,
#[error("failed to decode SmartModule record input")]
DecodingRecords = -22,
#[error("failed to encode SmartModule output")]
EncodingOutput = -33,
#[error("failed to parse SmartModule extra params")]
ParsingExtraParams = -44,
#[error("undefined right record in Join SmartModule")]
UndefinedRightRecord = -55,
}
#[repr(i32)]
#[derive(thiserror::Error, Debug, Clone, Eq, PartialEq, Encoder, Default, Decoder)]
#[non_exhaustive]
#[fluvio(encode_discriminant)]
pub enum SmartModuleInitErrorStatus {
#[error("encountered unknown error during SmartModule processing")]
#[default]
UnknownError = -1,
#[error("Error during initialization")]
InitError = -2,
#[error("failed to decode SmartModule init input")]
DecodingInput = -10,
#[error("failed to encode SmartModule init output")]
EncodingOutput = -11,
}
#[derive(thiserror::Error, Debug)]
pub enum SmartModuleInitError {
#[error("Missing param {0}")]
MissingParam(String),
}
#[repr(i32)]
#[derive(thiserror::Error, Debug, Clone, Eq, PartialEq, Encoder, Default, Decoder)]
#[non_exhaustive]
#[fluvio(encode_discriminant)]
pub enum SmartModuleLookbackErrorStatus {
#[error("encountered unknown error during SmartModule processing")]
#[default]
UnknownError = -1,
#[error("failed to decode SmartModule look_back input")]
DecodingBaseInput = -66,
#[error("failed to decode SmartModule look_back record input")]
DecodingRecords = -77,
#[error("failed to encode SmartModule look_back output")]
EncodingOutput = -88,
#[error("Error returned from user look_back function call")]
PropagatedError = -99,
}