Skip to content

Commit

Permalink
Using errormapper from bitrise-init (#128)
Browse files Browse the repository at this point in the history
* Removed code redundancy
  • Loading branch information
Mate Herber authored Nov 9, 2020
1 parent c33b9a8 commit af8aa6f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 238 deletions.
11 changes: 8 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

225 changes: 0 additions & 225 deletions errormapper/errormapper_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion gitclone/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"strconv"
"strings"

"github.com/bitrise-io/bitrise-init/errormapper"
"github.com/bitrise-io/bitrise-init/step"
"github.com/bitrise-io/go-utils/command"
"github.com/bitrise-io/go-utils/command/git"
Expand All @@ -21,7 +22,6 @@ import (
"github.com/bitrise-io/go-utils/pathutil"
"github.com/bitrise-io/go-utils/retry"
"github.com/bitrise-io/go-utils/sliceutil"
"github.com/bitrise-steplib/steps-git-clone/errormapper"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions gitclone/steperror.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package gitclone
import (
"fmt"

"github.com/bitrise-io/bitrise-init/errormapper"
"github.com/bitrise-io/bitrise-init/step"
"github.com/bitrise-steplib/steps-git-clone/errormapper"
)

func mapRecommendation(tag, errMsg string) step.Recommendation {
Expand Down Expand Up @@ -85,7 +85,7 @@ func newFetchFailedGenericDetailedError(params ...string) errormapper.DetailedEr
}
}

func newFetchFailedSSHAccessErrorDetailedError(params ...string) errormapper.DetailedError {
func newFetchFailedSSHAccessErrorDetailedError(...string) errormapper.DetailedError {
return errormapper.DetailedError{
Title: "We couldn’t access your repository.",
Description: "Please abort the process, double-check your SSH key and try again.",
Expand All @@ -100,7 +100,7 @@ func newFetchFailedCouldNotFindGitRepoDetailedError(params ...string) errormappe
}
}

func newFetchFailedHTTPAccessErrorDetailedError(params ...string) errormapper.DetailedError {
func newFetchFailedHTTPAccessErrorDetailedError(...string) errormapper.DetailedError {
return errormapper.DetailedError{
Title: "We couldn’t access your repository.",
Description: "Please abort the process and try again, by providing the repository with SSH URL.",
Expand All @@ -115,7 +115,7 @@ func newFetchFailedCouldConnectErrorDetailedError(params ...string) errormapper.
}
}

func newFetchFailedSamlSSOEnforcedDetailedError(params ...string) errormapper.DetailedError {
func newFetchFailedSamlSSOEnforcedDetailedError(...string) errormapper.DetailedError {
return errormapper.DetailedError{
Title: "To access this repository, you need to use SAML SSO.",
Description: `Please abort the process, update your SSH settings and try again. You can find out more about <a target="_blank" href="https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/authorizing-an-ssh-key-for-use-with-saml-single-sign-on">using SAML SSO in the Github docs</a>.`,
Expand Down
4 changes: 1 addition & 3 deletions gitclone/steperror_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import (
"reflect"
"testing"

"github.com/bitrise-io/bitrise-init/errormapper"
"github.com/bitrise-io/bitrise-init/step"
"github.com/bitrise-steplib/steps-git-clone/errormapper"
)

var mapRecommendationMock func(tag, errMsg string) step.Recommendation

func Test_mapRecommendation(t *testing.T) {
type args struct {
tag string
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af8aa6f

Please sign in to comment.