Skip to content

Commit

Permalink
fix: rewrite error messages for error in author file to be more descr…
Browse files Browse the repository at this point in the history
…iptive
  • Loading branch information
Slug-Boi committed Jan 13, 2025
1 parent 0e47a93 commit 2794a90
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/cmd/utils/user_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"bufio"
"fmt"
"os"
"strings"
)
Expand Down Expand Up @@ -47,11 +48,19 @@ func Define_users(author_file string) {
info := strings.Split(input_str, "|")
if len(info) < 4 {
if len(info) > 0 {
println("Error: User ", info[0], " is missing information")
if info[0] == "" {
info[0] = "(empty string)"
}
fmt.Println("Error: User", info[0], "is missing information")
} else {
fmt.Println("Error: Some user is missing information")
}
fmt.Println("Please check the author file for proper syntax")
if input_str == "" {
fmt.Println("empty line found in author file")
} else {
println("Error: Some user is missing information")
fmt.Println("author file input:", input_str)
}
println("Please check the author file for proper syntax")
os.Exit(1)
}
usr := User{Username: info[2], Email: info[3], Names: info[0] + "/" + info[1]}
Expand Down

0 comments on commit 2794a90

Please sign in to comment.