Skip to content

Commit 4571605

Browse files
committed
feat(error): stylize output
1 parent fdcd0de commit 4571605

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

error.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ import (
99
)
1010

1111
var (
12-
errorHeader = lipgloss.NewStyle().Foreground(lipgloss.Color("#F1F1F1")).Background(lipgloss.Color("#FF5F87")).Bold(true).Padding(0, 1).Margin(1).MarginLeft(2).SetString("ERROR")
13-
errorDetails = lipgloss.NewStyle().Foreground(lipgloss.Color("#757575"))
12+
errorHeader = lipgloss.NewStyle().
13+
Foreground(lipgloss.Color("#F1F1F1")).
14+
Background(lipgloss.Color("#FF5F87")).
15+
Bold(true).Padding(0, 1).
16+
Margin(1).
17+
MarginLeft(2).
18+
SetString("ERROR")
19+
errorDetails = lipgloss.NewStyle().
20+
Foreground(lipgloss.Color("#757575")).
21+
MarginLeft(2).
22+
MarginBottom(1)
1423
)
1524

1625
func printError(title string, err error) {
17-
// fmt.Println(lipgloss.JoinHorizontal(lipgloss.Center, errorHeader.String(), title))
26+
fmt.Println(lipgloss.JoinHorizontal(lipgloss.Center, errorHeader.String(), title))
1827
var b strings.Builder
1928
e := strings.TrimSpace(err.Error())
2029
e = strings.ReplaceAll(e, "\r", "")

0 commit comments

Comments
 (0)