errors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStyle

func GetStyle(errType ErrorType) lipgloss.Style

GetStyle returns the appropriate style for the given error type

Types

type Error

type Error struct {
	Type    ErrorType
	Message string

	Timestamp time.Time
	// contains filtered or unexported fields
}

Error represents an application error with additional context

func New

func New(errType ErrorType, message string) *Error

New creates a new error with the given type and message

func (*Error) GetMessage

func (e *Error) GetMessage() string

GetMessage returns the error message

func (*Error) GetType

func (e *Error) GetType() ErrorType

GetType returns the error type

func (*Error) Hide

func (e *Error) Hide()

Hide makes the error invisible

func (*Error) IsVisible

func (e *Error) IsVisible() bool

IsVisible returns whether the error is currently visible

func (*Error) Show

func (e *Error) Show()

Show makes the error visible

type ErrorType

type ErrorType int

ErrorType represents different types of errors that can occur

const (
	ErrorTypeValidation ErrorType = iota
	ErrorTypeFileSystem
	ErrorTypePermission
	ErrorTypeConfiguration
)

Jump to

Keyboard shortcuts

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