Exception: SecApi::PermanentError

Inherits:
Error
  • Object
show all
Defined in:
lib/sec_api/errors/permanent_error.rb

Overview

Base class for all non-retryable (permanent) errors.

Design rationale: PermanentError signals the retry middleware to fail immediately without retrying. Retrying a 401 (bad API key) or 404 (nonexistent resource) wastes resources and delays the inevitable failure. Fail fast with a clear message instead.

These errors require human intervention - code changes, configuration fixes, or different input parameters. The same request will always fail.

Permanent errors represent failures that won’t be resolved by retrying, such as authentication failures, validation errors, or resource not found. These errors require code or configuration changes to resolve.

Examples:

Catching all permanent errors

begin
  client.query.ticker("INVALID").search
rescue SecApi::PermanentError => e
  # No retry will help - requires action
  logger.error("Permanent failure: #{e.message}")
  notify_developer(e)
end

See Also:

Instance Attribute Summary

Attributes inherited from Error

#request_id

Method Summary

Methods inherited from Error

#initialize

Constructor Details

This class inherits a constructor from SecApi::Error