errdisplay

package
v0.0.0-...-9947234 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePathFromFrame

func FilePathFromFrame(frame Frame) string

FilePathFromFrame returns the file path from the frame.

If the file is part of the current application then it will be relative to the go.mod file of the application.

Otherwise it will be the package path.

func New

func New(cfg *config.Config, err error) tea.Model

New creates a new error display model

If cfg is nil then the default config will be used

Types

type Frame

type Frame struct {
	Path     string
	Filename string
	Line     int
	Package  string
	Function string
}

func DeepestStack

func DeepestStack(err error) []Frame

DeepestStack returns the deepest stack for the error.

func FilterCommonFrames

func FilterCommonFrames(cfg *config.Config, frames []Frame) []Frame

FilterCommonFrames filters out the common frames from the stack that are not useful for the user to see.

Such as internal frames from the runtime, coachcrockdb/errors, bubbletea, etc.

type Model

type Model struct {
	// contains filtered or unexported fields
}

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(_ tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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