Expand description
Error types for the parser.
This module defines all error types that can occur during replay parsing.
All errors implement the standard std::error::Error trait using
thiserror.
§Error Types
ParserError- Main error type for parsing operationsEntityError- Errors related to entity operationsClassError- Errors related to entity class lookupsStringTableError- Errors related to string table operationsGameEventError- Errors related to game event operationsFieldValueError- Errors related to field value conversions
§Examples
§Handling errors
use source2_demo::prelude::*;
use source2_demo::error::*;
match ctx.entities().get_by_index(0) {
Ok(entity) => println!("Entity: {}", entity.class().name()),
Err(EntityError::IndexNotFound(idx)) => {
println!("No entity at index {}", idx);
}
Err(e) => println!("Other error: {}", e),
}Enums§
- Class
Error - Errors related to entity class operations.
- Combat
LogError - Errors related to combat log operations (Dota 2 only).
- Entity
Error - Errors related to entity operations.
- Field
Value Error - Errors related to field value conversions.
- Game
Event Error - Errors related to game event operations.
- Parser
Error - Main error type for parser operations.
- Serializer
Error - Errors related to serializer operations.
- String
Table Error - Errors related to string table operations.