Skip to main content

Module debug_utils

Module debug_utils 

Source
Expand description

Debug utilities for bridge operations.

Translated from openclaudecode/src/bridge/debugUtils.ts

Functions§

debug_body
Truncate a JSON-serializable value for debug logging.
debug_truncate
Truncate a string for debug logging, collapsing newlines.
describe_axios_error
Extract a descriptive error message from an axios error (or any error). For HTTP errors, appends the server’s response body message if available.
extract_error_detail
Pull a human-readable message out of an API error response body. Checks data.message first, then data.error.message.
extract_http_status
Extract the HTTP status code from an axios error, if present. Returns None for non-HTTP errors (e.g. network failures).
log_bridge_skip
Log a bridge init skip — debug message + tengu_bridge_repl_skipped analytics event.
redact_secrets
Redact secrets from a string, replacing values with [REDACTED] or a partial reveal.