Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit a88b5f8

Browse files
committed
fix errors processing in a new repo processor
1 parent 45284bd commit a88b5f8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/analyze/processors/repo_processor.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,17 @@ func (r Repo) transformError(err error) error {
155155
return nil
156156
}
157157

158-
if ierr, ok := err.(*errorutils.InternalError); ok {
158+
causeErr := errors.Cause(err)
159+
if causeErr == fetchers.ErrNoBranchOrRepo {
160+
return causeErr
161+
}
162+
163+
if ierr, ok := causeErr.(*errorutils.InternalError); ok {
159164
if strings.Contains(ierr.PrivateDesc, noGoFilesToAnalyzeErr) {
160165
return errNothingToAnalyze
161166
}
162167

163-
return err
168+
return ierr
164169
}
165170

166171
return err
@@ -183,6 +188,10 @@ func (r Repo) errorToStatus(err error) string {
183188
return string(github.StatusError)
184189
}
185190

191+
if err == fetchers.ErrNoBranchOrRepo {
192+
return statusNotFound
193+
}
194+
186195
return string(github.StatusError)
187196
}
188197

0 commit comments

Comments
 (0)