Skip to main content

Module error

Module error 

Source
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

§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§

ClassError
Errors related to entity class operations.
CombatLogError
Errors related to combat log operations (Dota 2 only).
EntityError
Errors related to entity operations.
FieldValueError
Errors related to field value conversions.
GameEventError
Errors related to game event operations.
ParserError
Main error type for parser operations.
SerializerError
Errors related to serializer operations.
StringTableError
Errors related to string table operations.