do not bother printing index read errors
parent
6644d7a806
commit
34574c0713
4
main.go
4
main.go
|
@ -138,7 +138,7 @@ func indexPathFor(username string) (string, error) {
|
|||
}
|
||||
|
||||
if indexPath == "" {
|
||||
return "", fmt.Errorf("Failed to locate index file for %v; tried %v; encountered errors: %v", username, potentialPaths, errs)
|
||||
return "", fmt.Errorf("failed to locate index file for %v; tried %v; encountered errors: %v", username, potentialPaths, errs)
|
||||
}
|
||||
|
||||
return indexPath, nil
|
||||
|
@ -148,7 +148,6 @@ func pageTitleFor(username string) string {
|
|||
pageTitleRe := regexp.MustCompile(`<title[^>]*>(.*)</title>`)
|
||||
indexPath, err := indexPathFor(username)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
return ""
|
||||
}
|
||||
content, err := ioutil.ReadFile(indexPath)
|
||||
|
@ -201,7 +200,6 @@ func mtimeFor(username string) int64 {
|
|||
func detectDefaultPageFor(username string, defaultHTML []byte) bool {
|
||||
indexPath, err := indexPathFor(username)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
return false
|
||||
}
|
||||
indexFile, err := os.Open(indexPath)
|
||||
|
|
Loading…
Reference in New Issue