use std::io;
use std::num::ParseIntError;
use std::num::TryFromIntError;
use std::str::Utf8Error;
use std::string::FromUtf8Error;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum LoRaError {
#[error("IoError: {0}")]
Io(#[from] io::Error),
#[error("Error in conversion of Utf8")]
Utf8Error(#[from] Utf8Error),
#[error("Error in conversion of Utf8")]
FromUtf8Error(#[from] FromUtf8Error),
#[error("Error in conversion of Int")]
ParseIntError(#[from] ParseIntError),
#[error("Error in response from LoRa module")]
ResponseError(String),
#[error("Error reading error response from LoRa module")]
InternalError,
#[error("Error parsing transfer message")]
TransferTryFromError,
#[error("Error transfer incomplete")]
TransferIncomplete,
#[error("Error transfer context is invalid")]
TransferInvalid,
#[error("Error trying to convert from Int")]
TryFromIntError(#[from] TryFromIntError),
}