fix(android): ignore safedata store absence

This commit is contained in:
wpetit 2024-04-23 09:42:02 +02:00
parent 7ba540f56f
commit a20c6f5ff3

View File

@ -74,7 +74,7 @@ func main() {
safeDataConfigWaigGroup.Wait()
safe := safedata.NewSafeData(safeDataConfig)
instanceID, err := getInstanceIDFromSafeData(safe)
instanceID, err := getInstanceIDFromSafeData(ctx, safe)
if err != nil {
logger.Fatal(ctx, "could not retrieve instance id", logger.CapturedE(errors.WithStack(err)))
}
@ -112,10 +112,10 @@ func main() {
app.Main()
}
func getInstanceIDFromSafeData(safe *safedata.SafeData) (string, error) {
func getInstanceIDFromSafeData(ctx context.Context, safe *safedata.SafeData) (string, error) {
instanceIDSecret, err := safe.Get(instanceIDSecretIdentifier)
if err != nil && err.Error() != "not found" {
return "", errors.Wrapf(err, "could not retrieve instance id secret")
logger.Error(ctx, "could not retrieve instance id secret", logger.CapturedE(errors.WithStack(err)))
}
var instanceID string