ProviderError UI component

Purpose

ui.ProviderError renders a public-safe provider failure returned from a callback, resource request, or background effect. Render the returned node with ui.RenderHTML at the boundary.

Inputs

Field Required Type Behavior
Title yes string Error heading.
Summary no string Public-safe explanation; Message is accepted as a compatibility alias.
Code no string Public code-like metadata.
Status no any Numeric HTTP status, numeric string, accepted symbolic status, or empty for unknown.
RequestID no string Support-safe trace identifier.
Fields no map[string]string Public field path to public-safe validation message.
FieldErrors no []FieldError Structured field validation messages.
RetryLabel, Retry no string, ControlProps Retry control label and action metadata.
DismissLabel, Dismiss no string, ControlProps Dismiss control label and action metadata.
Severity no StatusSurfaceStatus Optional shared severity override.
HeadingLevel no int Heading level for the rendered title; defaults to 3.

Accepted symbolic statuses are:

Status Severity
"unauthenticated" danger
"unauthorized" danger
"forbidden" danger
"quota_exceeded" warning
"rate_limited" warning
"conflict" warning
"unavailable" warning
"unknown" neutral

Boundary

Raw provider payloads are not displayed. requestID may show a support-safe trace identifier, but it must not contain credentials or user-private payload data. Provider transport, retry policy, credential handling, raw payload storage, and product-specific error meaning stay outside bus-ui.

Example

package notesui

import "github.com/busdk/bus-ui/pkg/ui"

func UploadError() (string, error) {
	return ui.RenderHTML(ui.ProviderError(ui.ProviderErrorProps{
		Title:     "Upload failed",
		Summary:   "Access denied",
		Status:    403,
		RequestID: "req-123",
		RetryLabel: "Try again",
		Retry: ui.ControlProps{
			Action:   "provider.retry",
			SourceID: "upload",
		},
	}))
}

Legacy compatibility

The compatibility helpers remain available for callers that still need the historical checked or string-returning paths.

ProviderErrorFromResult projects a public-safe provider-error Result into render props. RedactProviderErrorText and RedactProviderRequestID are available for hosts that adapt provider diagnostics before checked rendering.