Extracts the primary event from a channel request's events list.
Prefers :destination_response, falls back to :error.
LightningWeb.ChannelRequestLive.Helpers (Lightning v2.19.0-pre)
View SourceShared helper functions for the channel request detail page.
Pure functions only — no templates. Provides error humanization, formatting utilities, and data extraction used across multiple component modules.
Summary
Functions
Classifies an error code as :transport, :credential, or nil (unknown).
Formats the client auth method used for a channel request for display.
Formats the destination credential used for a channel request for display.
Converts a classified error code into a human-readable description. Unknown codes pass through unchanged.
Extracts the primary event from a channel request's events list.
Prefers :destination_response, falls back to :error.
Functions
@spec error_category(String.t()) :: :transport | :credential | nil
Classifies an error code as :transport, :credential, or nil (unknown).
Formats the client auth method used for a channel request for display.
Returns "<name> (<auth type>)" when the matched method is present,
"(deleted) (<auth type>)" when the id is set but the association is
nil after preload (method deleted after the request ran), and the raw
auth type / "None" when no client auth was configured for the request.
Formats the destination credential used for a channel request for display.
Returns the credential name when present, "(deleted)" when the id is
still set but the credential has been deleted, and "None" when no
destination credential was configured.
Converts a classified error code into a human-readable description. Unknown codes pass through unchanged.