Skip to content
This repository has been archived by the owner on Aug 5, 2023. It is now read-only.

Commit

Permalink
Improved consistency of error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Jan 25, 2020
1 parent 073be6f commit 406c38a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ func main() {
pflag.Parse()

if *arbitraryPorts && !*arbitraryHosts {
fmt.Printf("Error: arbitrary-ports requires arbitrary-hosts to be enabled\n")
fmt.Printf("Error: arbitrary-ports requires arbitrary-hosts to be enabled.\n")
os.Exit(2)
}

cidrList, isWhitelist, err := parseCIDRBlackWhiteList(*cidrBlacklist, *cidrWhitelist)
if err != nil {
fmt.Printf("Error: error parsing cidr blacklist/whitelist: %v\n", err)
fmt.Printf("Error: error parsing cidr blacklist/whitelist: %v.\n", err)
os.Exit(2)
}

if len(cidrList) != 0 {
if err := checkCIDRBlackWhiteListHost(*host, cidrList, isWhitelist); err != nil {
fmt.Printf("Warning: default host does not parse cidr blacklist/whitelist: %v\n", err)
fmt.Printf("Warning: default host does not parse cidr blacklist/whitelist: %v.\n", err)
}
}

Expand All @@ -107,7 +107,7 @@ func main() {
for _, p := range *novncParams {
spl := strings.SplitN(p, "=", 2)
if len(spl) != 2 {
fmt.Printf("Error: error parsing noVNC params: must be in key=value format\n")
fmt.Printf("Error: error parsing noVNC params: must be in key=value format.\n")
os.Exit(2)
}

Expand Down Expand Up @@ -162,7 +162,7 @@ func main() {
fmt.Printf("Run with --help for more options\n")
}
if err := http.ListenAndServe(*addr, r); err != nil {
logf(true, "Error: %v\n", err)
logf(true, "Error: %v.\n", err)
os.Exit(1)
}
}
Expand Down

0 comments on commit 406c38a

Please sign in to comment.