Skip to content

Commit

Permalink
use WrapError to wrap errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodeymo committed Sep 27, 2024
1 parent a9278e8 commit a7a4fd7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aws/secretmanager/secretmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package secretmanager
import (
"context"

"github.com/Layr-Labs/eigensdk-go/utils"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/secretsmanager"
Expand All @@ -11,7 +12,7 @@ import (
func ReadStringFromSecretManager(ctx context.Context, secretName, region string) (string, error) {
config, err := config.LoadDefaultConfig(ctx, config.WithRegion(region))
if err != nil {
return "", err
return "", utils.WrapError("error while loading default config", err)
}

// Create Secrets Manager client
Expand All @@ -26,7 +27,7 @@ func ReadStringFromSecretManager(ctx context.Context, secretName, region string)
if err != nil {
// For a list of exceptions thrown, see
// https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html
return "", err
return "", utils.WrapError("error while loading default config", err)
}

// Decrypts secret using the associated KMS key.
Expand Down

0 comments on commit a7a4fd7

Please sign in to comment.