Skip to main content

Error

Enum Error 

Source
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.

Fields

§context: String
§index: u32
§

UnknownCompressionType

The compression type specified in the file is not supported.

Fields

§value: u32
§context: String
§

InvalidCompressedFileOffset

Fields

§compressed_file_offset_found: u64
§

InvalidFooterLength

The footer that should contain metadata did not properly indicate its length.

Fields

§footer_length_found: usize
§footer_offset_found: usize
§num_bytes: usize
§

InvalidFooterOffset

The offset to the footer didn’t correctly point to a location in the file.

Fields

§footer_offset_found: u64
§

Lz4DecompressionFailed

Unable to decompress a file.

Fields

§context: String
§compressed_length: usize
§decompressed_length: usize
§

NumberOfEntriesTooHigh

The number of entries in the file is too high to fit into a the given integer width.

Fields

§context: String
§value: u64
§bit_width: u32
§

CompressedFileSizeTooHigh

The compressed size of the file is too large to fit into a the given integer width.

Fields

§context: String
§value: u64
§bit_width: u32
§

DecompressedFileSizeTooHigh

The decompressed size of the file is too large to fit into a the given integer width.

Fields

§context: String
§value: u64
§bit_width: u32
§

CompressedMetadataSizeTooHigh

The compressed size of the metadata is too large to fit into a the given integer width.

Fields

§context: String
§value: u64
§bit_width: u32
§

StringLengthTooHigh

The length of

Fields

§context: String
§value: u64
§bit_width: u32
§

IndexTooHigh

The index of the entry is too large to fit into the given integer width.

Fields

§context: String
§value: u32
§bit_width: u32
§

InvalidIdentifier

The “magic number” used to identify the type of file didn’t match the expected value.

Fields

§expected_bytes: [u8; 4]
§bytes_found: [u8; 4]
§

InvalidModInfoAttributeCount

The number of attributes in the mod info section doesn’t match the expected count of 6.

Fields

§found: usize
§

InvalidMetadataFile

A meta.lsx file was found within an LSPK .pak archive that didn’t match the expected XML format.

Fields

§context: String
§

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.

Fields

§context: String
§inner: Error
§

MissingAttributeValue

The attribute with the given name was not found.

Fields

§name: &'static str
§

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.

Fields

§location: &'static str
§

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.

Fields

§version_number_found: u32
§

UnsupportedModPath(PathBuf)

The path isn’t supported for packing from.

§

UnableToReadZipFile(Error)

Available on crate feature zip only.

An error occured when trying to read the data from a zipfile.

§

ZlibDecompressionFailed

Unable to decompress a file.

Fields

§path: PathBuf
§error: Error
§

ZstdDecompressionFailed

Fields

§path: PathBuf
§error: String
§

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.

Fields

§attribute_id: String
§field: &'static str
§

LsfXmlUnknownType

LSF value has an unknown type.

Fields

§attribute_id: String
§type_name: String
§

LsfXmlWrongComponentCount

LSF value has the wrong number of components.

Fields

§attribute_id: String
§expected: usize
§found: usize
§

LsfXmlParse

LSF value failed to parse.

Fields

§attribute_id: String
§expected_type: String
§value: String
§inner: String
§

LsfXmlDecodeBase64

LSF value failed to decode base64.

Fields

§attribute_id: String

Implementations§

Source§

impl Error

Source

pub fn custom_io(context: impl Display, inner: Error) -> Self

Source

pub fn read_io(context: impl Display, inner: Error) -> Self

Source

pub fn write_io(context: impl Display, inner: Error) -> Self

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DeError> for Error

Source§

fn from(source: DeError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<SeError> for Error

Source§

fn from(source: SeError) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more