Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Commit da6ae21

Browse files
committed
some nitpicking
1 parent 13510f6 commit da6ae21

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

migration1/migration1.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ func (m *Migration1) Run(repoPath string) error {
2626
}
2727

2828
func (m *Migration1) migrate(repo afterrepo.ClockedRepo) error {
29-
m.readIdentities(repo)
29+
err := m.readIdentities(repo)
30+
if err != nil {
31+
fmt.Printf("Error while applying migration")
32+
// stop the migration
33+
return nil
34+
}
3035

3136
// Iterating through all the bugs in the repo
3237
for streamedBug := range afterbug.ReadAllLocal(repo) {
@@ -70,14 +75,15 @@ func (m *Migration1) migrate(repo afterrepo.ClockedRepo) error {
7075
return nil
7176
}
7277

73-
func (m *Migration1) readIdentities(repo afterrepo.ClockedRepo) {
78+
func (m *Migration1) readIdentities(repo afterrepo.ClockedRepo) error {
7479
for streamedIdentity := range afteridentity.ReadAllLocal(repo) {
7580
if streamedIdentity.Err != nil {
7681
fmt.Printf("Got error when reading identity: %q", streamedIdentity.Err)
77-
continue
82+
return streamedIdentity.Err
7883
}
7984
m.allIdentities = append(m.allIdentities, streamedIdentity.Identity)
8085
}
86+
return nil
8187
}
8288

8389
func (m *Migration1) migrateBug(oldBug *afterbug.Bug, repo afterrepo.ClockedRepo) (*afterbug.Bug, bool, error) {

0 commit comments

Comments
 (0)