use marlu::{io::error::BadArrayShape, mwalib};
use thiserror::Error;
use crate::corrections::{DigitalGainCorrection, PassbandCorrection};
#[derive(Error, Debug)]
#[allow(clippy::upper_case_acronyms)]
pub enum CLIError {
#[error("Invalid Command Line Argument")]
InvalidCommandLineArgument {
option: String,
expected: String,
received: String,
},
}
#[derive(Error, Debug)]
#[allow(clippy::upper_case_acronyms)]
pub enum BirliError {
#[error(transparent)]
IOError(#[from] crate::io::error::IOError),
#[error(transparent)]
CalibrationError(#[from] crate::calibration::CalibrationError),
#[error(transparent)]
ClapError(#[from] clap::Error),
#[error(transparent)]
CLIError(#[from] CLIError),
#[error(transparent)]
MwalibError(#[from] mwalib::MwalibError),
#[error(transparent)]
SelectionError(#[from] marlu::selection::SelectionError),
#[error(transparent)]
PassbandCorrection(#[from] PassbandCorrection),
#[error(transparent)]
DigitalGainCorrection(#[from] DigitalGainCorrection),
#[error("You selected dry run")]
DryRun {},
#[error(transparent)]
BadArrayShape(#[from] BadArrayShape),
#[error("Insufficient memory available; need {need_gib} GiB of memory.\nPlease specify the maximum amount of memory to use.")]
InsufficientMemory {
need_gib: usize,
},
#[error("Invalid MWA Version")]
BadMWAVersion {
message: String,
version: String,
},
}