View Source SwarmEx.Error (SwarmEx v0.1.0)

Defines custom error types and error handling utilities for SwarmEx.

This module provides a set of error exceptions specific to different failure modes in the SwarmEx system, along with helper functions for error handling and formatting.

Summary

Functions

Creates a standardized error context map.

Generates a correlation ID for error tracking.

Types

@type error_context() :: %{
  timestamp: DateTime.t(),
  network_id: String.t() | nil,
  correlation_id: String.t() | nil,
  metadata: map()
}
@type error_severity() :: :warning | :error | :critical
@type error_type() ::
  :agent | :tool | :network | :handoff | :initialization | :unknown

Functions

Link to this function

create_error_context(opts \\ [])

View Source
@spec create_error_context(keyword()) :: error_context()

Creates a standardized error context map.

Link to this function

generate_correlation_id()

View Source
@spec generate_correlation_id() :: String.t()

Generates a correlation ID for error tracking.