aboutsummaryrefslogtreecommitdiff
path: root/internal/route/repo
diff options
context:
space:
mode:
Diffstat (limited to 'internal/route/repo')
-rw-r--r--internal/route/repo/http.go7
-rw-r--r--internal/route/repo/view.go3
2 files changed, 4 insertions, 6 deletions
diff --git a/internal/route/repo/http.go b/internal/route/repo/http.go
index e8e1ac15..96ac22e0 100644
--- a/internal/route/repo/http.go
+++ b/internal/route/repo/http.go
@@ -17,7 +17,6 @@ import (
"strings"
"time"
- "github.com/pkg/errors"
"gopkg.in/macaron.v1"
log "unknwon.dev/clog/v2"
@@ -136,15 +135,15 @@ func HTTPContexter() macaron.Handler {
// or password as the token.
if authUser == nil {
authUser, err = context.AuthenticateByToken(c.Req.Context(), authUsername)
- if err != nil && !db.IsErrAccessTokenNotExist(errors.Cause(err)) {
+ if err != nil && !db.IsErrAccessTokenNotExist(err) {
c.Status(http.StatusInternalServerError)
log.Error("Failed to authenticate by access token via username: %v", err)
return
- } else if db.IsErrAccessTokenNotExist(errors.Cause(err)) {
+ } else if db.IsErrAccessTokenNotExist(err) {
// Try again using the password field as the token.
authUser, err = context.AuthenticateByToken(c.Req.Context(), authPassword)
if err != nil {
- if db.IsErrAccessTokenNotExist(errors.Cause(err)) {
+ if db.IsErrAccessTokenNotExist(err) {
askCredentials(c, http.StatusUnauthorized, "")
} else {
c.Status(http.StatusInternalServerError)
diff --git a/internal/route/repo/view.go b/internal/route/repo/view.go
index 89d6f86d..f4b6a162 100644
--- a/internal/route/repo/view.go
+++ b/internal/route/repo/view.go
@@ -13,7 +13,6 @@ import (
"time"
"github.com/gogs/git-module"
- "github.com/pkg/errors"
"github.com/unknwon/paginater"
log "unknwon.dev/clog/v2"
@@ -221,7 +220,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri
func setEditorconfigIfExists(c *context.Context) {
ec, err := c.Repo.Editorconfig()
- if err != nil && !gitutil.IsErrRevisionNotExist(errors.Cause(err)) {
+ if err != nil && !gitutil.IsErrRevisionNotExist(err) {
log.Warn("setEditorconfigIfExists.Editorconfig [repo_id: %d]: %v", c.Repo.Repository.ID, err)
return
}