diff options
Diffstat (limited to 'http_handle_repo_raw.go')
-rw-r--r-- | http_handle_repo_raw.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/http_handle_repo_raw.go b/http_handle_repo_raw.go index db20791..6b69720 100644 --- a/http_handle_repo_raw.go +++ b/http_handle_repo_raw.go @@ -26,16 +26,16 @@ func httpHandleRepoRaw(writer http.ResponseWriter, request *http.Request, params params["path_spec"] = pathSpec if refHash, err = getRefHash(repo, params["ref_type"].(string), params["ref_name"].(string)); err != nil { - http.Error(writer, "Error getting ref hash: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error getting ref hash: "+err.Error()) return } if commitObj, err = repo.CommitObject(refHash); err != nil { - http.Error(writer, "Error getting commit object: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error getting commit object: "+err.Error()) return } if tree, err = commitObj.Tree(); err != nil { - http.Error(writer, "Error getting file tree: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error getting file tree: "+err.Error()) return } @@ -47,14 +47,14 @@ func httpHandleRepoRaw(writer http.ResponseWriter, request *http.Request, params var file *object.File var fileContent string if file, err = tree.File(pathSpec); err != nil { - http.Error(writer, "Error retrieving path: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error retrieving path: "+err.Error()) return } if redirectNoDir(writer, request) { return } if fileContent, err = file.Contents(); err != nil { - http.Error(writer, "Error reading file: "+err.Error(), http.StatusInternalServerError) + errorPage500(writer, params, "Error reading file: "+err.Error()) return } fmt.Fprint(writer, fileContent) |