#[non_exhaustive]pub enum Error {
Show 15 variants
NotFound(String),
Ambiguous {
uri: String,
candidates: Vec<String>,
},
BadUri {
uri: String,
reason: String,
},
OutOfBounds {
location: String,
reason: String,
},
TooLarge {
location: String,
reason: String,
},
UnknownType(String),
Package(String),
Unsupported {
operation: &'static str,
store: &'static str,
},
UnstatedKind {
source_type: String,
why: &'static str,
},
Transaction {
store: &'static str,
reason: String,
},
ExternalData {
location: String,
reason: ExternalDataReason,
},
Io(Error),
Remote {
store: &'static str,
reason: String,
},
Xml(String),
Core(Error),
}Expand description
Something that stopped an operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound(String)
No object with this URI in the store.
Ambiguous
A short URI that names more than one object: the same uuid and type
held under several objectVersions. Identifier Specification v5.0
§3.4.2.1 (p. 15) leaves “the most recent” to the server and ETP 1.2 says
nothing of how to tell; this store does not guess, it names the
candidates - each spelled with its version, so any one of them resolves.
Fields
BadUri
The URI could not be parsed, or names something this store cannot hold.
OutOfBounds
A part of something asked for that is not inside it: a window of an array starting or reaching past an axis, a start or count whose rank is not the array’s. The request is wrong, not the data.
Fields
TooLarge
A request larger than the bound its caller set: answered by naming the size, never by returning a part of it as if it were the whole.
Fields
UnknownType(String)
The content type names a type no registered crate declares.
Package(String)
The package itself is malformed beyond what tolerance can absorb.
Unsupported
An operation this implementation does not offer.
Not a failure of the data: a capability the transport does not have.
UnstatedKind
A request by relationship kind met an edge whose kind nobody states.
ETP 1.2 section 8.1.1.1.2 (p. 157) leaves the kind of a relationship to
the ML of the object holding it, and the guide of an ML that has none
says nothing: the edge has no kind, and the request that needs one is
refused when it meets that edge, not before
(crate::context::discover).
Fields
source_type: StringThe qualified type of the object holding the reference
(prodml23.FlowTestActivity), or the URI when it has none.
why: &'static strWhy no rule applies (crate::kinds::KindBasis::Unknown).
Transaction
A transaction was misused: a second one opened while one is, or one ended that is not the open one (ETP protocol 18).
ExternalData
An external data file could not be reached or read.
Fields
reason: ExternalDataReasonWhy it could not be read.
Io(Error)
Reading or writing the underlying bytes failed.
Remote
A remote store failed as a whole - the session fell, the server refused the request. What the server said of one object or array comes back as that object’s own error instead.
Fields
store: &'static strWhich kind of store, as crate::storage::EnergymlStorage::store_kind says.
Xml(String)
The XML of a part could not be read.
Core(Error)
Anything raised by energyml-core while reading or writing an object.
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()