@@ -47,7 +47,7 @@ func (f *GiteaDownloaderFactory) New(ctx context.Context, opts base.MigrateOptio
4747
4848 path := strings .Split (repoNameSpace , "/" )
4949 if len (path ) < 2 {
50- return nil , fmt .Errorf ("invalid path" )
50+ return nil , fmt .Errorf ("invalid path: %s" , repoNameSpace )
5151 }
5252
5353 repoPath := strings .Join (path [len (path )- 2 :], "/" )
@@ -87,7 +87,7 @@ func NewGiteaDownloader(ctx context.Context, baseURL, repoPath, username, passwo
8787 gitea_sdk .SetContext (ctx ),
8888 )
8989 if err != nil {
90- log .Error (fmt .Sprintf ("NewGiteaDownloader: %s" , err . Error () ))
90+ log .Error (fmt .Sprintf ("Failed to create NewGiteaDownloader for : %s. Error: %v " , baseURL , err ))
9191 return nil , err
9292 }
9393
@@ -395,7 +395,7 @@ func (g *GiteaDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, err
395395
396396 reactions , err := g .getIssueReactions (issue .Index )
397397 if err != nil {
398- return nil , false , fmt .Errorf ("error while loading reactions: %v" , err )
398+ return nil , false , fmt .Errorf ("error while loading reactions for issue #%d. Error : %v" , issue . Index , err )
399399 }
400400
401401 var assignees []string
@@ -446,13 +446,13 @@ func (g *GiteaDownloader) GetComments(index int64) ([]*base.Comment, error) {
446446 // Page: i,
447447 }})
448448 if err != nil {
449- return nil , fmt .Errorf ("error while listing comments: %v" , err )
449+ return nil , fmt .Errorf ("error while listing comments for issue #%d. Error : %v" , index , err )
450450 }
451451
452452 for _ , comment := range comments {
453453 reactions , err := g .getCommentReactions (comment .ID )
454454 if err != nil {
455- return nil , fmt .Errorf ("error while listing comment creactions : %v" , err )
455+ return nil , fmt .Errorf ("error while listing reactions for comment %d in issue #%d. Error : %v" , comment . ID , index , err )
456456 }
457457
458458 allComments = append (allComments , & base.Comment {
@@ -490,7 +490,7 @@ func (g *GiteaDownloader) GetPullRequests(page, perPage int) ([]*base.PullReques
490490 State : gitea_sdk .StateAll ,
491491 })
492492 if err != nil {
493- return nil , false , fmt .Errorf ("error while listing repos : %v" , err )
493+ return nil , false , fmt .Errorf ("error while listing pull requests (page : %d, pagesize: %d). Error: %v" , page , perPage , err )
494494 }
495495 for _ , pr := range prs {
496496 var milestone string
@@ -521,7 +521,7 @@ func (g *GiteaDownloader) GetPullRequests(page, perPage int) ([]*base.PullReques
521521 if headSHA == "" {
522522 headCommit , _ , err := g .client .GetSingleCommit (g .repoOwner , g .repoName , url .PathEscape (pr .Head .Ref ))
523523 if err != nil {
524- return nil , false , fmt .Errorf ("error while resolving git ref: %v" , err )
524+ return nil , false , fmt .Errorf ("error while resolving head git ref: %s for pull #%d. Error: %v" , pr . Head . Ref , pr . Index , err )
525525 }
526526 headSHA = headCommit .SHA
527527 }
@@ -534,7 +534,7 @@ func (g *GiteaDownloader) GetPullRequests(page, perPage int) ([]*base.PullReques
534534
535535 reactions , err := g .getIssueReactions (pr .Index )
536536 if err != nil {
537- return nil , false , fmt .Errorf ("error while loading reactions: %v" , err )
537+ return nil , false , fmt .Errorf ("error while loading reactions for pull #%d. Error : %v" , pr . Index , err )
538538 }
539539
540540 var assignees []string
0 commit comments