problem

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package problem is the form in which aicoded check, describe, dev and mcp show coded errors, in text and in JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Problem

type Problem struct {
	App     string `json:"app,omitempty"`
	Code    string `json:"code,omitempty"`
	Pos     string `json:"pos,omitempty"`
	Message string `json:"message"`
	Fix     string `json:"fix,omitempty"`
	Docs    string `json:"docs,omitempty"`
}

Problem is one coded error of an app, or an error without a code, which has only Message.

func From

func From(app string, err error) []Problem

From returns one problem per *errs.Error in err's tree (through Unwrap() error and Unwrap() []error), or one problem with only Message when there is none.

func FromErrs

func FromErrs(app string, es []*errs.Error) []Problem

FromErrs returns one problem per coded error.

func (Problem) String

func (p Problem) String() string

String returns the problem as errs.Error prints it, after "<app>: " when it has an app.

Jump to

Keyboard shortcuts

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