Skip to main content

Module errors

Module errors 

Source
Expand description

§Error Types

This module provides a comprehensive set of error types used throughout the gooty-proxy crate. Each error type is designed to encapsulate specific failure modes for different subsystems.

§Overview

The module contains several error enums, each focused on a specific domain:

  • CidrError: For errors related to CIDR notation and subnet operations
  • RequestorError: For HTTP request related failures
  • FilestoreError: For disk operations and file management errors
  • ConfigError: For configuration parsing and validation errors
  • ProxyError: For proxy-specific validation and connection errors
  • SourceError: For proxy source acquisition failures
  • JudgementError: For proxy validation and testing errors
  • UtilError: For general utility function failures
  • OwnershipError: For ASN and organization lookup failures
  • SleuthError: For IP investigation failures
  • ManagerError: For high-level proxy management errors

Each error type has a corresponding Result type alias for more convenient function signatures.

§Examples

use gooty_proxy::definitions::errors::{CidrError, CidrResult};

fn parse_cidr(input: &str) -> CidrResult<()> {
    if !input.contains('/') {
        return Err(CidrError::InvalidFormat("Missing prefix".to_string()));
    }
    // Additional parsing logic...
    Ok(())
}

Enums§

CidrError
Represents error types that can occur during CIDR operations.
ConfigError
Errors that can occur during configuration operations
FilestoreError
Errors that can occur in the filestore
JudgementError
Error types that can occur during proxy judgement
ManagerError
Errors that can occur in the proxy manager
OwnershipError
Error types that can occur during ASN and organization lookups
ProxyError
Errors that can occur when validating or working with proxies
RequestorError
Error types that can occur during HTTP requests
SleuthError
Errors that can occur during IP lookup operations
SourceError
Represents an error that can occur when working with proxy sources
UtilError
Error types for utility functions

Type Aliases§

CidrResult
Result type for CIDR operations
ConfigResult
Result type for configuration operations
FilestoreResult
Result type for filestore operations
JudgementResult
Result type for judgement operations
ManagerResult
Result type for proxy manager operations
OwnershipResult
Result type for ownership operations
RequestResult
Result type for HTTP requests
SleuthResult
Result type for Sleuth operations
SourceResult
Result type for source operations
UtilResult
Result type for utility functions