Documentation
¶
Overview ¶
Package publicerror turns an error into text that is safe to show a client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Message ¶
Message returns err's readable chain without the source locations ctxerrors appends. An error in the chain that is Public gives its own text instead. A nil error gives an empty string.
func Text ¶ added in v0.31.0
Text is Message for error text that was already rendered, such as a failure detail a record kept. ctxerrors formats as "message: wrapped [file:line in func]", and nested wraps append their own marker, so every marker sits after the readable chain and the first one is where the text stops being safe to publish.
func WithMessage ¶ added in v0.46.0
WithMessage returns an error whose public text is text and that still matches cause under errors.Is and errors.As.