#[non_exhaustive]pub enum Error {
Show 24 variants
Transmission(Error),
Io(Error),
Commit(Error),
DimensionMismatch {
n: usize,
b_len: usize,
},
ShapeMismatch {
what: &'static str,
expected: usize,
got: usize,
},
UnsupportedOpfObjective {
reason: String,
},
UnsupportedAcPfSpecification,
UnknownConstraintIdentity {
family: &'static str,
identity: String,
},
DuplicateElementIdentity {
family: &'static str,
identity: String,
},
SingularNetwork,
InvalidSensitivityOptions {
reason: String,
},
NoGenerators,
UnsupportedCostModel {
gen_index: usize,
model: u8,
ncost: usize,
},
InvalidPiecewiseCost {
gen_index: usize,
reason: PiecewiseCostInvalidity,
},
NonconvexPiecewiseCost {
gen_index: usize,
segment: usize,
},
PiecewiseNodalCost {
gen_index: usize,
},
ConcaveCost {
gen_index: usize,
c2: f64,
},
Mtx(String),
Parquet(String),
EmptyScenarioBatch,
ScenarioIdOverflow {
base: i64,
index: usize,
},
NormalizedGridfmSnapshot {
scenario: i64,
},
NonFiniteGridfmValue {
scenario: i64,
element: &'static str,
row: usize,
field: &'static str,
value: f64,
},
ScenarioShapeMismatch {
index: usize,
reason: ScenarioMismatch,
},
}Expand description
A matrix, sensitivity, or dataset failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transmission(Error)
A failure from the balanced model, its readers, or its writers.
Io(Error)
An underlying I/O failure this crate raised itself.
One the transmission model raised arrives as Error::Transmission wrapping
powerio_tx::Error::Io, so a caller telling I/O apart from the rest reads
Error::category rather than matching this variant.
Commit(Error)
A refused or failed destination commit (an output collision, an invalid inventory, a staging failure), carrying the registered core failure. Code and category delegate to it.
DimensionMismatch
ShapeMismatch
UnsupportedOpfObjective
UnsupportedAcPfSpecification
UnknownConstraintIdentity
DuplicateElementIdentity
SingularNetwork
InvalidSensitivityOptions
NoGenerators
UnsupportedCostModel
InvalidPiecewiseCost
NonconvexPiecewiseCost
PiecewiseNodalCost
ConcaveCost
Mtx(String)
Parquet(String)
EmptyScenarioBatch
ScenarioIdOverflow
NormalizedGridfmSnapshot
NonFiniteGridfmValue
ScenarioShapeMismatch
Fields
index: usize0-based position of the offending snapshot in the batch (independent of the snapshot’s scenario id).
reason: ScenarioMismatchImplementations§
Source§impl Error
impl Error
Sourcepub fn code(&self) -> &'static DiagnosticInfo
pub fn code(&self) -> &'static DiagnosticInfo
The registry entry for this error. The match is exhaustive over the variant set, so a new variant must be coded here before it compiles.
A hub failure keeps the hub’s own code: restating it here would give one failure two identities.
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Classify this error, using the hub’s taxonomy.
The match is exhaustive over the variant set, so a new variant must be classified here before it compiles.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()