Skip to content

Commit

Permalink
error detail
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Dec 7, 2023
1 parent 80ed360 commit e46a5af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion migrations/20231128_jellyfish_migration/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,29 @@ func getValidatedTime(bsonData bson.M, fieldName string) (string, error) {
}

func datumHash(bsonData bson.M) (string, error) {

identityFields := []string{}
if datumUserID, err := GetValidatedString(bsonData, "_userId"); err != nil {
log.Printf("invalid data _userId: %#v", bsonData)
return "", err
} else {
identityFields = append(identityFields, datumUserID)
}
if deviceID, err := GetValidatedString(bsonData, "deviceId"); err != nil {
log.Printf("invalid data deviceId: %#v", bsonData)
return "", err
} else {
identityFields = append(identityFields, deviceID)
}
if datumTime, err := getValidatedTime(bsonData, "time"); err != nil {
log.Printf("invalid data time: %#v", bsonData)
return "", err
} else {
identityFields = append(identityFields, datumTime)
}
datumType, err := GetValidatedString(bsonData, "type")
if err != nil {
log.Printf("invalid data: %#v", bsonData)
log.Printf("invalid data type: %#v", bsonData)
return "", err
}
identityFields = append(identityFields, datumType)
Expand Down

0 comments on commit e46a5af

Please sign in to comment.