impl ErrorParser
{
pub fn parse_api_error( _response : &str ) -> AnthropicResult< EnhancedAnthropicError >
{
Err( AnthropicError::NotImplemented( "ErrorParser not fully implemented".to_string() ) )
}
}
impl ErrorMapper
{
pub fn map_http_status( _status : u16, _message : &str ) -> AnthropicResult< EnhancedAnthropicError >
{
Err( AnthropicError::NotImplemented( "ErrorMapper not fully implemented".to_string() ) )
}
}
impl ErrorClassifier
{
pub fn classify_timeout( _timeout_error : &TimeoutError ) -> AnthropicResult< TimeoutClassification >
{
Err( AnthropicError::NotImplemented( "ErrorClassifier not fully implemented".to_string() ) )
}
}
impl ErrorRecovery
{
pub fn analyze_error( _error : &AnthropicError ) -> AnthropicResult< RecoveryStrategy >
{
Err( AnthropicError::NotImplemented( "ErrorRecovery not fully implemented".to_string() ) )
}
}
impl RecoveryStrategy
{
#[ must_use ]
pub fn should_retry( &self ) -> bool
{
self.should_retry
}
#[ must_use ]
pub fn max_retries( &self ) -> u32
{
self.max_retries
}
#[ must_use ]
pub fn backoff_strategy( &self ) -> BackoffStrategy
{
self.backoff_strategy.clone()
}
#[ must_use ]
pub fn base_delay( &self ) -> Duration
{
self.base_delay
}
#[ must_use ]
pub fn requires_user_action( &self ) -> bool
{
self.requires_user_action
}
#[ must_use ]
pub fn suggested_action( &self ) -> &str
{
&self.suggested_action
}
}
impl ActionableError
{
pub fn from_error( _error : &AnthropicError ) -> AnthropicResult< ActionableError >
{
Err( AnthropicError::NotImplemented( "ActionableError not fully implemented".to_string() ) )
}
#[ must_use ]
pub fn remediation_steps( &self ) -> &Vec< String >
{
&self.remediation_steps
}
#[ must_use ]
pub fn has_documentation_links( &self ) -> bool
{
!self.documentation_links.is_empty()
}
#[ must_use ]
pub fn estimated_fix_time( &self ) -> &Option< Duration >
{
&self.estimated_fix_time
}
}
impl BatchError
{
pub fn from_error( _error : &AnthropicError ) -> AnthropicResult< BatchError >
{
Err( AnthropicError::NotImplemented( "BatchError not fully implemented".to_string() ) )
}
#[ must_use ]
pub fn error_count( &self ) -> usize
{
self.errors.len()
}
#[ must_use ]
pub fn has_partial_success( &self ) -> bool
{
self.has_partial_success
}
#[ must_use ]
pub fn errors( &self ) -> &Vec< EnhancedAnthropicError >
{
&self.errors
}
#[ must_use ]
pub fn summary( &self ) -> &str
{
&self.summary
}
}
impl TimeoutClassification
{
#[ must_use ]
pub fn timeout_type( &self ) -> TimeoutType
{
self.timeout_type.clone()
}
#[ must_use ]
pub fn is_network_related( &self ) -> bool
{
self.is_network_related
}
#[ must_use ]
pub fn is_server_processing_related( &self ) -> bool
{
self.is_server_processing_related
}
#[ must_use ]
pub fn suggested_timeout_increase( &self ) -> Duration
{
self.suggested_timeout_increase
}
#[ must_use ]
pub fn supports_streaming_fallback( &self ) -> bool
{
self.supports_streaming_fallback
}
}
impl NetworkErrorClassifier
{
pub fn classify( _error : &NetworkError ) -> AnthropicResult< NetworkErrorClassification >
{
Err( AnthropicError::NotImplemented( "NetworkErrorClassifier not fully implemented".to_string() ) )
}
}
impl NetworkErrorClassification
{
#[ must_use ]
pub fn error_type( &self ) -> NetworkErrorType
{
self.error_type.clone()
}
#[ must_use ]
pub fn is_infrastructure_related( &self ) -> bool
{
self.is_infrastructure_related
}
#[ must_use ]
pub fn is_security_related( &self ) -> bool
{
self.is_security_related
}
#[ must_use ]
pub fn is_service_availability_related( &self ) -> bool
{
self.is_service_availability_related
}
#[ must_use ]
pub fn suggested_actions( &self ) -> &Vec< String >
{
&self.suggested_actions
}
#[ must_use ]
pub fn supports_retry_with_backoff( &self ) -> bool
{
self.supports_retry_with_backoff
}
}
impl BackoffCalculator
{
#[ cfg( feature = "retry-logic" ) ]
pub fn calculate_backoff( error : &RateLimitError ) -> AnthropicResult< BackoffStrategyDetails >
{
let base_delay = if let Some( retry_after ) = error.retry_after()
{
( *retry_after * 1000 ).max( 1000 ) }
else
{
match error.limit_type()
{
"authentication" => 5000, "tokens" => 2000, _ => 1000, }
};
let strategy = BackoffStrategyDetails {
initial_delay : Duration::from_millis( base_delay ),
backoff_type : BackoffType::Linear,
max_retries : 5,
jitter_enabled : true,
suggested_batch_size_reduction : Some( 0.5 ),
};
Ok( strategy )
}
#[ cfg( not( feature = "retry-logic" ) ) ]
pub fn calculate_backoff( _error : &RateLimitError ) -> AnthropicResult< BackoffStrategyDetails >
{
Err( AnthropicError::NotImplemented( "BackoffCalculator requires retry-logic feature".to_string() ) )
}
}
impl BackoffStrategyDetails
{
#[ must_use ]
pub fn initial_delay( &self ) -> Duration
{
self.initial_delay
}
#[ must_use ]
pub fn backoff_type( &self ) -> BackoffType
{
self.backoff_type.clone()
}
#[ must_use ]
pub fn max_retries( &self ) -> u32
{
self.max_retries
}
#[ must_use ]
pub fn jitter_enabled( &self ) -> bool
{
self.jitter_enabled
}
#[ must_use ]
pub fn suggested_batch_size_reduction( &self ) -> &Option< f32 >
{
&self.suggested_batch_size_reduction
}
}
impl CredentialHintGenerator
{
pub fn generate_hints( _error : &AuthenticationError ) -> AnthropicResult< CredentialHints >
{
Err( AnthropicError::NotImplemented( "CredentialHintGenerator not fully implemented".to_string() ) )
}
}
impl CredentialHints
{
#[ must_use ]
pub fn remediation_steps( &self ) -> &Vec< String >
{
&self.remediation_steps
}
#[ must_use ]
pub fn has_format_example( &self ) -> bool
{
self.has_format_example
}
#[ must_use ]
pub fn documentation_link( &self ) -> Option< &String >
{
self.documentation_link.as_ref()
}
#[ must_use ]
pub fn requires_renewal( &self ) -> bool
{
self.requires_renewal
}
#[ must_use ]
pub fn renewal_instructions( &self ) -> Option< &String >
{
self.renewal_instructions.as_ref()
}
#[ must_use ]
pub fn estimated_resolution_time( &self ) -> Option< &Duration >
{
self.estimated_resolution_time.as_ref()
}
#[ must_use ]
pub fn permission_upgrade_required( &self ) -> bool
{
self.permission_upgrade_required
}
#[ must_use ]
pub fn required_permissions( &self ) -> Option< &Vec< String > >
{
self.required_permissions.as_ref()
}
#[ must_use ]
pub fn upgrade_instructions( &self ) -> Option< &String >
{
self.upgrade_instructions.as_ref()
}
}
impl ErrorSerializer
{
pub fn serialize( _error : &EnhancedAnthropicError ) -> AnthropicResult< String >
{
Err( AnthropicError::NotImplemented( "ErrorSerializer not fully implemented".to_string() ) )
}
pub fn deserialize( _json : &str ) -> AnthropicResult< EnhancedAnthropicError >
{
Err( AnthropicError::NotImplemented( "ErrorSerializer not fully implemented".to_string() ) )
}
}
impl ErrorLogger
{
#[ must_use ]
pub fn new() -> Self
{
Self
}
pub fn log_error( &self, _error : &AnthropicError ) -> AnthropicResult< LogEntry >
{
Err( AnthropicError::NotImplemented( "ErrorLogger not fully implemented".to_string() ) )
}
}
impl Default for ErrorLogger
{
fn default() -> Self
{
Self::new()
}
}
impl LogEntry
{
#[ must_use ]
pub fn has_structured_data( &self ) -> bool
{
!self.structured_data.is_empty()
}
#[ must_use ]
pub fn severity( &self ) -> LogSeverity
{
self.severity.clone()
}
#[ must_use ]
pub fn contains_field( &self, field : &str ) -> bool
{
self.structured_data.contains_key( field )
}
}
impl ErrorMetrics
{
#[ must_use ]
pub fn new() -> Self
{
Self
{
error_counts : std::collections::HashMap::new(),
alert_thresholds : std::collections::HashMap::new(),
}
}
pub fn report_error( &mut self, _error : &AnthropicError ) -> AnthropicResult< () >
{
Err( AnthropicError::NotImplemented( "ErrorMetrics not fully implemented".to_string() ) )
}
#[ must_use ]
pub fn error_count( &self, error_type : &str ) -> u64
{
self.error_counts.get( error_type ).copied().unwrap_or( 0 )
}
#[ must_use ]
pub fn has_alert_thresholds( &self ) -> bool
{
!self.alert_thresholds.is_empty()
}
}
impl Default for ErrorMetrics
{
fn default() -> Self
{
Self::new()
}
}
impl CorrelationTracker
{
pub fn from_error( _error : &AnthropicError ) -> AnthropicResult< CorrelationTracker >
{
Err( AnthropicError::NotImplemented( "CorrelationTracker not fully implemented".to_string() ) )
}
pub fn get_summary( _correlation_id : &str ) -> AnthropicResult< CorrelationSummary >
{
Err( AnthropicError::NotImplemented( "CorrelationTracker not fully implemented".to_string() ) )
}
#[ must_use ]
pub fn correlation_id( &self ) -> &'static str
{
"test_correlation_id"
}
#[ must_use ]
pub fn request_sequence( &self ) -> usize
{
1
}
#[ must_use ]
pub fn has_related_errors( &self ) -> bool
{
true
}
}
impl CorrelationSummary
{
#[ must_use ]
pub fn total_requests( &self ) -> u32
{
self.total_requests
}
#[ must_use ]
pub fn failed_requests( &self ) -> u32
{
self.failed_requests
}
#[ must_use ]
pub fn error_patterns( &self ) -> &Vec< String >
{
&self.error_patterns
}
}
impl ErrorLocalizer
{
pub fn localize( _error : &AnthropicError, _locale : &str ) -> AnthropicResult< LocalizedError >
{
Err( AnthropicError::NotImplemented( "ErrorLocalizer not fully implemented".to_string() ) )
}
}
impl LocalizedError
{
#[ must_use ]
pub fn message( &self ) -> &str
{
&self.message
}
#[ must_use ]
pub fn locale( &self ) -> &str
{
&self.locale
}
}