Skip to content

Commit

Permalink
chore: tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Oct 19, 2024
1 parent b50fe0f commit 3ea4087
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ import (
)

var (
errorHeader = lipgloss.NewStyle().Foreground(lipgloss.Color("#F1F1F1")).Background(lipgloss.Color("#FF5F87")).Bold(true).Padding(0, 1).Margin(1).MarginLeft(2).SetString("ERROR")
errorDetails = lipgloss.NewStyle().Foreground(lipgloss.Color("#757575")).Margin(0, 0, 1, 2)
errorHeader = lipgloss.NewStyle().
Foreground(lipgloss.Color("#F1F1F1")).
Background(lipgloss.Color("#FF5F87")).
Bold(true).
Padding(0, 1).
Margin(1).
MarginLeft(2).
SetString("ERROR")
errorDetails = lipgloss.NewStyle().
Foreground(lipgloss.Color("#757575")).
Margin(0, 0, 1, 2)
)

func printError(title string, err error) {
fmt.Printf("%s\n", lipgloss.JoinHorizontal(lipgloss.Center, errorHeader.String(), title))
rendered := errorDetails.Render(err.Error())
fmt.Println(rendered)
fmt.Printf("%s\n", rendered)
fmt.Println(lipgloss.JoinHorizontal(lipgloss.Center, errorHeader.String(), title))
fmt.Println(errorDetails.Render(err.Error()))
}

func printErrorFatal(title string, err error) {
Expand Down

0 comments on commit 3ea4087

Please sign in to comment.