Skip to content

Commit b7c8f87

Browse files
authored
Merge pull request #3 from nytimes/check-err
2 parents fc81a57 + ec0026a commit b7c8f87

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

plugin/path_generate.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@ type FastlyToken struct {
3030
}
3131

3232
func (b *backend) pathGenerate(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
33-
3433
config, err := b.config(ctx, req.Storage)
34+
if err != nil {
35+
return &logical.Response{
36+
Data: map[string]interface{}{
37+
"error": err.Error(),
38+
},
39+
}, nil
40+
}
3541

3642
// Validate the data passed in the field and preprocess them so they can be used directly for generating tokens
3743
validatedData, err := validateAndPreprocessInputParams(data)
38-
3944
if err != nil {
4045
return &logical.Response{
4146
Data: map[string]interface{}{

0 commit comments

Comments
 (0)