runfailure

package
v2.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package runfailure maps the error a ZapScript run ends with onto the stable category and safe message every client-facing report of that run shares: the run method's error response and the run.failed notification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Classify

func Classify(err error) (category, message string)

Classify returns the category and message for a terminal run error. The message never carries a filesystem path or token contents; the cause stays with the caller for logging and errors.Is.

func Notify

func Notify(ns chan<- models.Notification, t *tokens.Token, err error, pls *playlists.Playlist)

Notify sends run.failed for a run of t that ended with err. pls is the playlist the run was an item of, or nil. The script is the token's own text, redacted as token history stores it; a token that carries parsed commands instead of text reports those. A script over the length bound is left out: it was never run, and redacting it would mean parsing it.

Types

type CommandError

type CommandError struct {
	Err  error
	Name string
}

CommandError is the failure of one command in a script. It names the command so a report of the run can say which step failed, and unwraps to the cause so errors.Is keeps matching the sentinels.

func (*CommandError) Error

func (e *CommandError) Error() string

func (*CommandError) Unwrap

func (e *CommandError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL