mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Remove another panic call
This commit is contained in:
parent
7b4c77b7da
commit
b9d1017754
@ -152,7 +152,8 @@ func createWtfConfigDir() {
|
|||||||
func createWtfConfigFile() {
|
func createWtfConfigFile() {
|
||||||
filePath, err := CreateFile(WtfConfigFile)
|
filePath, err := CreateFile(WtfConfigFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
displayDefaultConfigCreateError(err)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the file is empty, write to it
|
// If the file is empty, write to it
|
||||||
|
@ -18,8 +18,14 @@ func displayError(err error) {
|
|||||||
fmt.Printf("%s %s\n\n", aurora.Red("Error:"), err.Error())
|
fmt.Printf("%s %s\n\n", aurora.Red("Error:"), err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func displayDefaultConfigCreateError(err error) {
|
||||||
|
fmt.Printf("\n%s Could not create the default configuration file.\n", aurora.Red("ERROR"))
|
||||||
|
fmt.Println()
|
||||||
|
displayError(err)
|
||||||
|
}
|
||||||
|
|
||||||
func displayDefaultConfigWriteError(err error) {
|
func displayDefaultConfigWriteError(err error) {
|
||||||
fmt.Printf("\n%s Could not write the default configuration.\n", aurora.Red("ERROR"))
|
fmt.Printf("\n%s Could not write the default configuration file.\n", aurora.Red("ERROR"))
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
displayError(err)
|
displayError(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user