fix(forge): wrap helper parse errors
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
51dfbe8de0
commit
61d2b8440a
7 changed files with 16 additions and 9 deletions
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -214,7 +215,7 @@ func (s *ActionsService) ListRepoTasks(ctx context.Context, owner, repo string,
|
||||||
if opts.Page > 0 || opts.Limit > 0 {
|
if opts.Page > 0 || opts.Limit > 0 {
|
||||||
u, err := url.Parse(path)
|
u, err := url.Parse(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("ActionsService.ListRepoTasks", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
if opts.Page > 0 {
|
if opts.Page > 0 {
|
||||||
|
|
|
||||||
3
admin.go
3
admin.go
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -439,7 +440,7 @@ func (s *AdminService) ListActionsRuns(ctx context.Context, filters AdminActions
|
||||||
|
|
||||||
u, err := url.Parse("/api/v1/admin/actions/runs")
|
u, err := url.Parse("/api/v1/admin/actions/runs")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("AdminService.ListActionsRuns", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"iter"
|
"iter"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -30,7 +31,7 @@ func (s *ContentService) ListContents(ctx context.Context, owner, repo, ref stri
|
||||||
if ref != "" {
|
if ref != "" {
|
||||||
u, err := url.Parse(path)
|
u, err := url.Parse(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("ContentService.ListContents", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
q.Set("ref", ref)
|
q.Set("ref", ref)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -285,7 +286,7 @@ func (s *NotificationService) listPage(ctx context.Context, path string, opts Li
|
||||||
|
|
||||||
u, err := url.Parse(path)
|
u, err := url.Parse(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("NotificationService.listPage", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
values := u.Query()
|
values := u.Query()
|
||||||
|
|
|
||||||
3
pulls.go
3
pulls.go
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -234,7 +235,7 @@ func (s *PullService) listPage(ctx context.Context, owner, repo string, opts Lis
|
||||||
path := ResolvePath("/api/v1/repos/{owner}/{repo}/pulls", pathParams("owner", owner, "repo", repo))
|
path := ResolvePath("/api/v1/repos/{owner}/{repo}/pulls", pathParams("owner", owner, "repo", repo))
|
||||||
u, err := url.Parse(path)
|
u, err := url.Parse(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("PullService.listPage", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
values := u.Query()
|
values := u.Query()
|
||||||
|
|
|
||||||
7
repos.go
7
repos.go
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -466,7 +467,7 @@ func (s *RepoService) GetRawFileOrLFS(ctx context.Context, owner, repo, filepath
|
||||||
if ref != "" {
|
if ref != "" {
|
||||||
u, err := url.Parse(path)
|
u, err := url.Parse(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("RepoService.GetRawFileOrLFS", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
q.Set("ref", ref)
|
q.Set("ref", ref)
|
||||||
|
|
@ -482,7 +483,7 @@ func (s *RepoService) GetEditorConfig(ctx context.Context, owner, repo, filepath
|
||||||
if ref != "" {
|
if ref != "" {
|
||||||
u, err := url.Parse(path)
|
u, err := url.Parse(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return core.E("RepoService.GetEditorConfig", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
q.Set("ref", ref)
|
q.Set("ref", ref)
|
||||||
|
|
@ -651,7 +652,7 @@ func (s *RepoService) SearchRepositoriesPage(ctx context.Context, query string,
|
||||||
|
|
||||||
u, err := url.Parse("/api/v1/repos/search")
|
u, err := url.Parse("/api/v1/repos/search")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("RepoService.SearchRepositoriesPage", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
|
|
|
||||||
3
users.go
3
users.go
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
core "dappco.re/go/core"
|
||||||
"dappco.re/go/core/forge/types"
|
"dappco.re/go/core/forge/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -132,7 +133,7 @@ func (s *UserService) SearchUsersPage(ctx context.Context, query string, pageOpt
|
||||||
|
|
||||||
u, err := url.Parse("/api/v1/users/search")
|
u, err := url.Parse("/api/v1/users/search")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, core.E("UserService.SearchUsersPage", "forge: parse path", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
q := u.Query()
|
q := u.Query()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue