cinzelerror

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2026 YLD Limited SPDX-License-Identifier: Apache-2.0 Package cinzelerror provides structured error types and sentinel errors for the cinzel CLI. It wraps HCL diagnostic errors into standard Go errors and attaches "open issue" guidance to user-facing messages.

Index

Constants

View Source
const (
	OpenIssue string = "if you think this is incorrect, consider opening an issue in https://www.github.com/yldio/cinzel/issues"
)

OpenIssue is the message appended to errors suggesting users file a bug report.

Variables

View Source
var (
	ErrWorkflowFilenameRequired = errWorkflowFilenameRequired()
	ErrOnlyHclFiles             = errOnlyHclFiles()
	ErrOnRestriction            = errOnRestriction()
	ErrSecretsRestriction       = errSecretsRestriction()
	ErrWorkflowEmptyOn          = errWorkflowEmptyOn()
	ErrOpenIssue                = errOpenIssue()
)

Sentinel errors for workflow and HCL validation.

Functions

func ErrJobEmptySteps

func ErrJobEmptySteps(jobId string) error

ErrJobEmptySteps returns an error indicating the job has no steps.

func ErrWorkflowEmptyJobs

func ErrWorkflowEmptyJobs(workflowId string) error

ErrWorkflowEmptyJobs returns an error indicating the workflow has no jobs.

func ProcessHCLDiags

func ProcessHCLDiags(diags hcl.Diagnostics) error

ProcessHCLDiags converts HCL diagnostics into a single joined error.

Types

type Error

type Error struct {
	Err error
}

Error wraps an underlying error with additional context and issue-reporting guidance.

func New

func New(err error, messages ...string) Error

New creates an Error from err and optional context messages, appending the OpenIssue text.

func NewFromResource

func NewFromResource(err error, resourceType string, resourceId string) Error

NewFromResource creates an Error annotated with the resource type and identifier.

func (*Error) Error

func (e *Error) Error() string

Error returns the string representation of the wrapped error.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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