diff --git a/modules/context/api.go b/modules/context/api.go
index f7a3384691..d405c9972b 100644
--- a/modules/context/api.go
+++ b/modules/context/api.go
@@ -337,7 +337,7 @@ func RepoRefForAPI(next http.Handler) http.Handler {
 				if git.IsErrNotExist(err) {
 					ctx.NotFound()
 				} else {
-					ctx.Error(http.StatusInternalServerError, "GetBlobByPath", err)
+					ctx.Error(http.StatusInternalServerError, "GetCommit", err)
 				}
 				return
 			}