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§
- CliError
Renderer - CLI error renderer with ANSI color support
- CliRenderer
Config - Configuration for CLI error rendering
- Error
Context - Error context builder for adding context to errors
- Error
Note - Additional notes for error messages
- Highlight
- A highlight/underline on a source line
- Related
Info - Related information (e.g., “unclosed brace opened here”)
- Source
Context - Source context for rendering
- Source
Line - A single source line with metadata
- Source
Location - Source location information for error reporting
- Structured
Parse Error - A complete structured parse error with all context needed for rendering
- Suggestion
- A suggestion for fixing the error
- Text
Edit - Text edit for auto-fix
- Token
Info - Information about a found token
Enums§
- Error
Code - Error codes for structured error reporting
- Error
Severity - Error severity levels
- Expected
Token - What token/construct was expected
- Highlight
Style - Identifier
Context - Context where an identifier was expected
- Missing
Component Kind - What component is missing
- Number
Error - Why a number is invalid
- Parse
Error Kind - Specific parse error variants with structured context
- Shape
Error - The main error type for Shape operations
- String
Delimiter - String delimiter types
- Suggestion
Confidence - Token
Category - Categories of expected tokens for grouping
- Token
Kind - Token kinds for better error messages
Traits§
- Error
Renderer - Trait for rendering structured parse errors to different output formats
- Result
Ext - 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