Skip to main content

Module error

Module error 

Source
Expand description

Unified error handling for Shape

This module provides a comprehensive error type that covers all error cases in the Shape language, from parsing to execution.

Modules§

context
Error context and helper utilities
conversions
Type conversions for ShapeError
formatting
Error formatting and display utilities
impls
Trait implementations for error types
macros
Error handling macros for reducing boilerplate in function implementations
parse_error
Structured parse error types for Shape
pest_converter
Pest error to structured error conversion
renderer
Error rendering for different output targets
suggestions
Error suggestion and hint generation
types
Core error types and enums for Shape

Structs§

CliErrorRenderer
CLI error renderer with ANSI color support
CliRendererConfig
Configuration for CLI error rendering
ErrorContext
Error context builder for adding context to errors
ErrorNote
Additional notes for error messages
Highlight
A highlight/underline on a source line
RelatedInfo
Related information (e.g., “unclosed brace opened here”)
SourceContext
Source context for rendering
SourceLine
A single source line with metadata
SourceLocation
Source location information for error reporting
StructuredParseError
A complete structured parse error with all context needed for rendering
Suggestion
A suggestion for fixing the error
TextEdit
Text edit for auto-fix
TokenInfo
Information about a found token

Enums§

ErrorCode
Error codes for structured error reporting
ErrorSeverity
Error severity levels
ExpectedToken
What token/construct was expected
HighlightStyle
IdentifierContext
Context where an identifier was expected
MissingComponentKind
What component is missing
NumberError
Why a number is invalid
ParseErrorKind
Specific parse error variants with structured context
ShapeError
The main error type for Shape operations
StringDelimiter
String delimiter types
SuggestionConfidence
TokenCategory
Categories of expected tokens for grouping
TokenKind
Token kinds for better error messages

Traits§

ErrorRenderer
Trait for rendering structured parse errors to different output formats
ResultExt
Extension trait for Result types to add error context

Functions§

span_to_location
Convert a byte-offset Span to line/column SourceLocation

Type Aliases§

Result
Result type alias for Shape operations