#[derive(thiserror::Error, Debug, Clone, PartialEq, Eq)]
pub enum ClassError {
#[error("The 'VERSION' keyword is missing from the class file header.")]
VersionKeywordMissing,
#[error("The 'BEGIN' keyword is missing from the class file header.")]
BeginKeywordMissing,
#[error("The 'Class' keyword is missing from the class file header.")]
KeywordMissing,
#[error(
"After the 'VERSION' keyword there should be a space before the major version number."
)]
WhitespaceMissingBetweenVersionAndMajorVersionNumber,
#[error("The 'VERSION' keyword should be in uppercase to be fully compatible with Microsoft's VB6 IDE.")]
VersionKeywordNotFullyUppercase {
version_text: String,
},
#[error("The 'CLASS' keyword should be in uppercase to be fully compatible with Microsoft's VB6 IDE.")]
KeywordNotFullyUppercase {
class_text: String,
},
#[error("The 'BEGIN' keyword should be in uppercase to be fully compatible with Microsoft's VB6 IDE.")]
BeginKeywordNotFullyUppercase {
begin_text: String,
},
#[error(
"The 'END' keyword should be in uppercase to be fully compatible with Microsoft's VB6 IDE."
)]
EndKeywordNotFullyUppercase {
end_text: String,
},
#[error("The 'BEGIN' keyword should stand alone on its own line.")]
BeginKeywordShouldBeStandAlone,
#[error("The 'END' keyword should stand alone on its own line.")]
EndKeywordShouldBeStandAlone,
#[error("Unable to parse the major version number. Following the 'VERSION' keyword should be a major version number, a '.', and a minor version number.")]
UnableToParseMajorVersionNumber,
#[error("Unable to convert the major version text to a number. Following the 'VERSION' keyword should be a major version number, a '.', and a minor version number.")]
UnableToConvertMajorVersionNumber,
#[error("Unable to parse the minor version number. Following the 'VERSION' keyword should be a major version number, a '.', and a minor version number.")]
UnableToParseMinorVersionNumber,
#[error("Unable to convert the minor version text to a number. Following the 'VERSION' keyword should be a major version number, a '.', and a minor version number.")]
UnableToConvertMinorVersionNumber,
#[error("The '.' divider between major and minor version digits is missing.")]
MissingPeriodDividerBetweenMajorAndMinorVersion,
#[error("Missing whitespace between minor version digits and 'CLASS' keyword. This may not be compliant with Microsoft's VB6 IDE.")]
MissingWhitespaceAfterMinorVersion,
#[error("Between the minor version digits and the 'CLASS' keyword should be a single ASCII space. This may not be compliant with Microsoft's VB6 IDE.")]
IncorrectWhitespaceAfterMinorVersion,
#[error("Whitespace was used to divide between major and minor version information. This may not be compliant with Microsoft's VB6 IDE.")]
WhitespaceDividerBetweenMajorAndMinorVersionNumbers,
#[error("CST parsing error: {message}")]
CSTError {
message: String,
},
}