Expand description
Error types for ReasonKit Web
This module provides a comprehensive error type hierarchy using thiserror
for proper error handling across all components.
§Error Categories
WebError- HTTP-level errors with status codes and JSON responsesError- Internal operation errors (browser, MCP, extraction)- Domain-specific errors:
BrowserError,McpError,ExtractionError, etc.
§Example
use reasonkit_web::error::{WebError, Result};
fn process_request(data: &str) -> Result<String> {
if data.is_empty() {
return Err(WebError::invalid_request("Data cannot be empty").into());
}
Ok(data.to_uppercase())
}Structs§
- Error
Response - Structured JSON error response for serialization
- Request
Context - Request context for error handling
Enums§
- Browser
Error - Browser lifecycle and control errors
- Capture
Error - Capture errors (screenshots, PDFs, etc.)
- Error
- The main error type for ReasonKit Web internal operations
- Extraction
Error - Content extraction errors
- McpError
- MCP protocol errors
- Navigation
Error - Navigation errors
- WebError
- HTTP-level error with status codes and structured JSON responses.
Functions§
- generate_
request_ id - Generate a unique request ID for tracing