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 == "" {
|
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
|
return indexPath, nil
|
||||||
|
@ -148,7 +148,6 @@ func pageTitleFor(username string) string {
|
||||||
pageTitleRe := regexp.MustCompile(`<title[^>]*>(.*)</title>`)
|
pageTitleRe := regexp.MustCompile(`<title[^>]*>(.*)</title>`)
|
||||||
indexPath, err := indexPathFor(username)
|
indexPath, err := indexPathFor(username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
content, err := ioutil.ReadFile(indexPath)
|
content, err := ioutil.ReadFile(indexPath)
|
||||||
|
@ -201,7 +200,6 @@ func mtimeFor(username string) int64 {
|
||||||
func detectDefaultPageFor(username string, defaultHTML []byte) bool {
|
func detectDefaultPageFor(username string, defaultHTML []byte) bool {
|
||||||
indexPath, err := indexPathFor(username)
|
indexPath, err := indexPathFor(username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
indexFile, err := os.Open(indexPath)
|
indexFile, err := os.Open(indexPath)
|
||||||
|
|
Loading…
Reference in New Issue