File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,28 @@ import (
55 "os"
66
77 "github.com/charmbracelet/lipgloss"
8+ "github.com/charmbracelet/x/ansi"
89)
910
1011var (
11- errorHeader = lipgloss .NewStyle ().Foreground (lipgloss .Color ("#F1F1F1" )).Background (lipgloss .Color ("#FF5F87" )).Bold (true ).Padding (0 , 1 ).Margin (1 ).MarginLeft (2 ).SetString ("ERROR" )
12- errorDetails = lipgloss .NewStyle ().Foreground (lipgloss .Color ("#757575" )).Margin (0 , 0 , 1 , 2 )
12+ errorHeader = lipgloss .NewStyle ().
13+ Foreground (lipgloss .Color ("#F1F1F1" )).
14+ Background (lipgloss .Color ("#FF5F87" )).
15+ Bold (true ).
16+ Padding (0 , 1 ).
17+ Margin (1 ).
18+ MarginLeft (2 ).
19+ SetString ("ERROR" )
20+ errorDetails = lipgloss .NewStyle ().
21+ Background (lipgloss .Color ("52" )).
22+ Foreground (lipgloss .Color ("#757575" )).
23+ Margin (0 , 0 , 1 , 2 )
1324)
1425
1526func printError (title string , err error ) {
1627 fmt .Println (lipgloss .JoinHorizontal (lipgloss .Center , errorHeader .String (), title ))
17- fmt .Println (errorDetails .Render (err .Error ()))
28+ rendered := errorDetails .Render (err .Error ())
29+ fmt .Println (ansi .Strip (rendered ))
1830}
1931
2032func printErrorFatal (title string , err error ) {
You can’t perform that action at this time.
0 commit comments