DNS.Error (DNS v0.5.0)

View Source

Centralized error handling for DNS operations to prevent information disclosure.

This module provides standardized error messages that don't expose internal buffer contents or sensitive information that could be used by attackers.

Summary

Functions

Log detailed errors internally for debugging while returning generic messages to clients.

Create a standardized error message that doesn't expose sensitive information.

Types

error_type()

@type error_type() ::
  :format_error
  | :parse_error
  | :validation_error
  | :compression_error
  | :security_error

Functions

log_detailed_error(type, module, reason, context \\ %{})

@spec log_detailed_error(error_type(), module(), term(), map()) :: :ok

Log detailed errors internally for debugging while returning generic messages to clients.

new(type, module, reason, context \\ %{})

@spec new(error_type(), module(), term(), map()) :: {String.t(), map()}

Create a standardized error message that doesn't expose sensitive information.