pub enum Error {
Show 15 variants
MissingFileNameError,
UnsupportedFormatVersionError(SCXVersion),
TooManyDisabledTechsError(i32),
CannotDisableTechsError,
CannotDisableUnitsError,
TooManyDisabledBuildingsError(i32, i32),
CannotDisableBuildingsError,
DecodeStringError(DecodeStringError),
EncodeStringError(EncodeStringError),
ParseDiplomaticStanceError(ParseDiplomaticStanceError),
ParseDataSetError(ParseDataSetError),
ParseDLCPackageError(ParseDLCPackageError),
ParseStartingAgeError(ParseStartingAgeError),
ParseAIErrorCodeError(TryFromPrimitiveError<AIErrorCode>),
IoError(Error),
}Expand description
Error type for SCX methods, containing all types of errors that may occur while reading or writing scenario files.
Variants§
MissingFileNameError
The scenario that’s attempted to be read does not contain a file name.
UnsupportedFormatVersionError(SCXVersion)
Attempted to read a scenario with an unsupported format version identifier.
TooManyDisabledTechsError(i32)
Attempted to write a scenario with disabled technologies, to a version that doesn’t support this many disabled technologies.
CannotDisableTechsError
Attempted to write a scenario with disabled technologies, to a version that doesn’t support disabling technologies.
CannotDisableUnitsError
Attempted to write a scenario with disabled units, to a version that doesn’t support disabling units.
TooManyDisabledBuildingsError(i32, i32)
Attempted to write a scenario with disabled buildings, to a version that doesn’t support this many disabled buildings.
CannotDisableBuildingsError
Attempted to write a scenario with disabled buildings, to a version that doesn’t support disabling buildings.
DecodeStringError(DecodeStringError)
Failed to decode a string from the scenario file, probably because of a wrong encoding.
EncodeStringError(EncodeStringError)
Failed to encode a string into the scenario file, probably because of a wrong encoding.
ParseDiplomaticStanceError(ParseDiplomaticStanceError)
The given ID is not a known diplomatic stance.
ParseDataSetError(ParseDataSetError)
The given ID is not a known data set.
ParseDLCPackageError(ParseDLCPackageError)
The given ID is not a known HD Edition DLC.
ParseStartingAgeError(ParseStartingAgeError)
The given ID is not a known starting age in AoE1 or AoE2.
ParseAIErrorCodeError(TryFromPrimitiveError<AIErrorCode>)
The given ID is not a known error code.
IoError(Error)
An error occurred while reading or writing.