#[non_exhaustive]pub enum Error {
Show 22 variants
Detect(DetectError),
OutOfBounds {
what: &'static str,
pos: i128,
need: u64,
have: u64,
reader: ReaderKind,
length: usize,
},
Malformed {
what: &'static str,
detail: Arc<str>,
},
WebSignature(RawStr),
BundleSignature(RawStr),
Unsupported(Unsupported),
UnityCnKeyLength {
length: usize,
},
UnityCnKeyMissing,
UnityCnVectorLength {
length: usize,
},
UnityCnSignature,
Decompress {
codec: Codec,
detail: Arc<str>,
},
Version(VersionError),
TypeIndex {
index: i32,
len: usize,
},
Tree(TreeError),
AssetBundle(Arc<ParseError>),
Entry {
name: RawStr,
source: Arc<Error>,
},
Limit(LimitError),
Budget(BudgetExceeded),
Allocator(AllocError),
NotFound(NotFound),
Deref(Arc<DerefError>),
Io(IoError),
}Expand description
Why loading a file failed. Never a panic.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Detect(DetectError)
check_file_type raised (the dump’s "detect").
OutOfBounds
A read past the end where UnityPy raises too (struct.error, EOFError).
Fields
pos: i128The reader’s position at the read: a Python position, which may be
negative or past the end (crate::stream::Reader::position).
reader: ReaderKindRules of the reader whose read failed.
Malformed
Input UnityPy rejects with an exception other than a short read.
Fields
WebSignature(RawStr)
The decoded signature rejected by the WebFile constructor. Keep only
a charged copy, so an error cannot retain an entire inflated input.
BundleSignature(RawStr)
The rejected bundle signature, copied into charged storage so nested failures identify their own input without retaining its whole buffer.
Unsupported(Unsupported)
A format or feature unityrs does not read (yet), each named.
UnityCnKeyLength
UnityPy’s key setter raises ValueError for this length.
UnityCnKeyMissing
UnityPy raises LookupError after reading an encrypted header without a key.
UnityCnVectorLength
AES raises ValueError for a short header key vector.
UnityCnSignature
UnityPy raises a plain Exception when the AES signature differs.
Decompress
A block failed to decode.
Fields
Version(VersionError)
A version string did not parse, or no fallback was set.
TypeIndex
From format 16, an object’s type_id outside types (Python indexing:
negative counts from the end; ObjectReader.py:98-101).
Tree(TreeError)
A typetree’s rows could not be built into a tree, or the tree is over a limit.
AssetBundle(Arc<ParseError>)
The AssetBundle object read at load failed, which fails the file
(SerializedFile.py:316-324; CANONICAL_DUMP.md section 7).
Entry
A bundle entry failed, which fails the bundle (File.py:76-90).
Limit(LimitError)
A bound from crate::limits::Limits was exceeded (the input’s
meter included: LimitKind::InputMemory).
Budget(BudgetExceeded)
The memory budget refused a reservation, or the allocator failed.
Allocator(AllocError)
The host allocator refused storage; no heap-owned source is retained.
NotFound(NotFound)
A CAB, external, object or resource that is not there.
Deref(Arc<DerefError>)
A pointer that could not be followed where the caller raises it (the
container preload, helpers/ContainerHelper.py:43-46, plan 3.13).
A failure to load the target is that load’s own error, never this.
Io(IoError)
An I/O error from a source.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_dependency_budget_refusal(&self) -> bool
pub fn is_dependency_budget_refusal(&self) -> bool
Whether the dependency budget refused a reservation, including when
an entry or object read wraps the refusal. A refusal carried inside a
ParseError::Provider is not recognised here; callers that retry
provider reads classify that case themselves.
Trait Implementations§
Source§impl CellError for Error
impl CellError for Error
Source§fn is_transient(&self) -> bool
fn is_transient(&self) -> bool
crate::LimitKind::InputMemory), an I/O failure, a
provider’s failure. Such an error is returned, never published.Source§fn is_meter_refusal(&self) -> bool
fn is_meter_refusal(&self) -> bool
crate::LimitKind::InputMemory), and not the budget, I/O or a
provider: what a computation that ends in it was granted counts as
its open’s work (module docs).Source§fn heap_bytes(&self) -> u64
fn heap_bytes(&self) -> u64
crate::limits::heap_cost of each Arc
and string it holds, counted whether or not a string shares a file’s
buffer), charged to the input’s meter while a cell keeps it. A clone
shares that heap and allocates nothing.Source§fn work_refused(limit: LimitError) -> Self
fn work_refused(limit: LimitError) -> Self
limit is a crate::LimitKind::DecodeWork refusal): not
transient, so the cell keeps it (module docs).impl Eq for Error
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()