Skip to main content

Module error

Module error 

Source
Expand description

Error types and error reporting for AgentScript.

This module provides structured error types and pretty error reporting using the ariadne crate for colorful, context-aware error messages.

§Error Types

§Pretty Printing

Use ErrorReporter for user-friendly error output:

use busbar_sf_agentscript::error::{ErrorReporter, ParseErrorInfo};

let source = "config:\n   agent_name: bad";
let reporter = ErrorReporter::new("example.agent", source);

// Create and report an error
let error = ParseErrorInfo {
    message: "Expected string literal".to_string(),
    span: Some(18..21),
    expected: vec!["string".to_string()],
    found: Some("identifier".to_string()),
    contexts: vec![],
};
// reporter.report_parse_error(&error); // Prints colorful error

Structs§

ErrorReporter
Error reporter that uses ariadne for pretty error output.
ParseErrorInfo
Information about a parse error.
ValidationError
Validation error for semantic issues.

Enums§

AgentScriptError
The main error type for AgentScript operations.

Type Aliases§

Result
Result type for AgentScript operations.