pub enum Error {
Show 43 variants
InvalidParentIndex {
context: String,
index: u32,
},
UnknownCompressionType {
value: u32,
context: String,
},
InvalidCompressedFileOffset {
compressed_file_offset_found: u64,
},
InvalidFooterLength {
footer_length_found: usize,
footer_offset_found: usize,
num_bytes: usize,
},
InvalidFooterOffset {
footer_offset_found: u64,
},
Lz4DecompressionFailed {
context: String,
error: DecompressError,
compressed_length: usize,
decompressed_length: usize,
},
NumberOfEntriesTooHigh {
context: String,
value: u64,
bit_width: u32,
},
CompressedFileSizeTooHigh {
context: String,
value: u64,
bit_width: u32,
},
DecompressedFileSizeTooHigh {
context: String,
value: u64,
bit_width: u32,
},
CompressedMetadataSizeTooHigh {
context: String,
value: u64,
bit_width: u32,
},
StringLengthTooHigh {
context: String,
value: u64,
bit_width: u32,
},
IndexTooHigh {
context: String,
value: u32,
bit_width: u32,
},
InvalidIdentifier {
expected_bytes: [u8; 4],
bytes_found: [u8; 4],
},
InvalidModInfoAttributeCount {
found: usize,
},
InvalidMetadataFile {
context: String,
},
MissingModInfoFolder,
MissingModInfoMd5,
MissingModInfoName,
MissingModInfoPublishHandle,
MissingModInfoUuid,
MissingModInfoVersion,
Io {
context: String,
inner: Error,
},
MissingAttributeValue {
name: &'static str,
},
MissingLspkFileInZip,
MissingMetadataFile,
MissingModuleInfo,
ParseIntError {
inner: ParseIntError,
location: &'static str,
},
TableEntryDecompressionFailed(DecompressError),
TooShort,
UnsupportedVersion {
version_number_found: u32,
},
UnsupportedModPath(PathBuf),
UnableToReadZipFile(Error),
ZlibDecompressionFailed {
path: PathBuf,
error: Error,
},
ZstdDecompressionFailed {
path: PathBuf,
error: String,
},
ZstdNotSupported,
XmlDeserialize(DeError),
XmlSerialize(SeError),
XmlWrite(Error),
LsfXmlMissingField {
attribute_id: String,
field: &'static str,
},
LsfXmlUnknownType {
attribute_id: String,
type_name: String,
},
LsfXmlWrongComponentCount {
attribute_id: String,
expected: usize,
found: usize,
},
LsfXmlParse {
attribute_id: String,
expected_type: String,
value: String,
inner: String,
},
LsfXmlDecodeBase64 {
attribute_id: String,
inner: DecodeError,
},
}Expand description
Errors that can occur when processing BG3 files.
Variants§
InvalidParentIndex
The parent index specified in the .lsf file was not found when parsing the file.
UnknownCompressionType
The compression type specified in the file is not supported.
InvalidCompressedFileOffset
The footer that should contain metadata did not properly indicate its length.
The offset to the footer didn’t correctly point to a location in the file.
Lz4DecompressionFailed
Unable to decompress a file.
NumberOfEntriesTooHigh
The number of entries in the file is too high to fit into a the given integer width.
CompressedFileSizeTooHigh
The compressed size of the file is too large to fit into a the given integer width.
DecompressedFileSizeTooHigh
The decompressed size of the file is too large to fit into a the given integer width.
CompressedMetadataSizeTooHigh
The compressed size of the metadata is too large to fit into a the given integer width.
StringLengthTooHigh
The length of
IndexTooHigh
The index of the entry is too large to fit into the given integer width.
InvalidIdentifier
The “magic number” used to identify the type of file didn’t match the expected value.
InvalidModInfoAttributeCount
The number of attributes in the mod info section doesn’t match the expected count of 6.
InvalidMetadataFile
A meta.lsx file was found within an LSPK .pak archive that didn’t match the expected XML format.
MissingModInfoFolder
The mod info section is missing the "Folder" attribute.
MissingModInfoMd5
The mod info section is missing the "MD5" attribute.
MissingModInfoName
The mod info section is missing the "Name" attribute.
MissingModInfoPublishHandle
The mod info section is missing the "PublishHandle" attribute.
MissingModInfoUuid
The mod info section is missing the "UUID" attribute.
MissingModInfoVersion
The mod info section is missing the "Version" attribute.
Io
An I/O error occured.
MissingAttributeValue
The attribute with the given name was not found.
MissingLspkFileInZip
No meta.lsx file was found in an LSPK .pak file. A zipfile didn’t contain any file with the .pak extension.
MissingMetadataFile
No meta.lsx file was found in the LSPK file.
MissingModuleInfo
The LSX file is missing the required "ModuleInfo" node.
ParseIntError
The an integer value could not be parsed from the LSX file at the given location.
TableEntryDecompressionFailed(DecompressError)
An error occurred when trying to parse the path of a file within an LSPK .pak archive.
TooShort
The file being read was too short to contain all of the expected metadata of the given format.
UnsupportedVersion
The version number read when parsing the file was lower than the minimum supported version.
UnsupportedModPath(PathBuf)
The path isn’t supported for packing from.
UnableToReadZipFile(Error)
zip only.An error occured when trying to read the data from a zipfile.
ZlibDecompressionFailed
Unable to decompress a file.
ZstdDecompressionFailed
ZstdNotSupported
The file contains zstd-compressed data, but this tool does not currently support it.
XmlDeserialize(DeError)
The LSX data could not be parsed.
XmlSerialize(SeError)
The LSX data could not be serialized.
XmlWrite(Error)
The LSX data could not be written to a file.
LsfXmlMissingField
LSF attribute is missing a required field.
LsfXmlUnknownType
LSF value has an unknown type.
LsfXmlWrongComponentCount
LSF value has the wrong number of components.
LsfXmlParse
LSF value failed to parse.
LsfXmlDecodeBase64
LSF value failed to decode base64.
Implementations§
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more