caffeine_lang/errors
Types
Represents top level compilation errors.
pub type CompilationError {
FrontendParseError(msg: String, context: ErrorContext)
FrontendValidationError(msg: String, context: ErrorContext)
LinkerValueValidationError(msg: String, context: ErrorContext)
LinkerDuplicateError(msg: String, context: ErrorContext)
LinkerParseError(msg: String, context: ErrorContext)
LinkerVendorResolutionError(msg: String, context: ErrorContext)
SemanticAnalysisTemplateParseError(
msg: String,
context: ErrorContext,
)
SemanticAnalysisTemplateResolutionError(
msg: String,
context: ErrorContext,
)
SemanticAnalysisDependencyValidationError(
msg: String,
context: ErrorContext,
)
GeneratorSloQueryResolutionError(
msg: String,
context: ErrorContext,
)
GeneratorTerraformResolutionError(
vendor: String,
msg: String,
context: ErrorContext,
)
CQLResolverError(msg: String, context: ErrorContext)
CQLParserError(msg: String, context: ErrorContext)
CompilationErrors(errors: List(CompilationError))
}
Constructors
-
FrontendParseError(msg: String, context: ErrorContext) -
FrontendValidationError(msg: String, context: ErrorContext) -
LinkerValueValidationError(msg: String, context: ErrorContext) -
LinkerDuplicateError(msg: String, context: ErrorContext) -
LinkerParseError(msg: String, context: ErrorContext) -
LinkerVendorResolutionError(msg: String, context: ErrorContext) -
SemanticAnalysisTemplateParseError( msg: String, context: ErrorContext, ) -
SemanticAnalysisTemplateResolutionError( msg: String, context: ErrorContext, ) -
SemanticAnalysisDependencyValidationError( msg: String, context: ErrorContext, ) -
GeneratorSloQueryResolutionError( msg: String, context: ErrorContext, ) -
GeneratorTerraformResolutionError( vendor: String, msg: String, context: ErrorContext, ) -
CQLResolverError(msg: String, context: ErrorContext) -
CQLParserError(msg: String, context: ErrorContext) -
CompilationErrors(errors: List(CompilationError))
Machine-readable error code for diagnostic output.
pub type ErrorCode {
ErrorCode(phase: String, number: Int)
}
Constructors
-
ErrorCode(phase: String, number: Int)
Structured context attached to every compilation error.
pub type ErrorContext {
ErrorContext(
identifier: option.Option(String),
source_path: option.Option(String),
source_content: option.Option(String),
location: option.Option(SourceLocation),
suggestion: option.Option(String),
)
}
Constructors
-
ErrorContext( identifier: option.Option(String), source_path: option.Option(String), source_content: option.Option(String), location: option.Option(SourceLocation), suggestion: option.Option(String), )
A source location within a file (1-indexed).
pub type SourceLocation {
SourceLocation(
line: Int,
column: Int,
end_column: option.Option(Int),
)
}
Constructors
-
SourceLocation( line: Int, column: Int, end_column: option.Option(Int), )
Values
pub fn empty_context() -> ErrorContext
Returns an ErrorContext with all fields set to None.
pub fn error_code_for(error: CompilationError) -> ErrorCode
Assigns an error code based on the CompilationError variant.