Skip to content

Commit

Permalink
Return error if create credential request is not a bad request
Browse files Browse the repository at this point in the history
  • Loading branch information
Bharath Joginapally authored and Bharath Joginapally committed Dec 20, 2022
1 parent 8a3654a commit 4d4a3b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (p *CreateOrUpdateCredential) Run(ctx context.Context, w http.ResponseWrite
errors.Is(err, conv.ErrInvalidModelConversion) ||
errors.Is(err, &conv.ErrModelConversion{}) {
return armrpc_rest.NewBadRequestResponse(err.Error()), nil
} else if err != nil {
return nil, err
}

if newResource.Properties.Kind != datamodel.AWSCredentialKind {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (p *CreateOrUpdateCredential) Run(ctx context.Context, w http.ResponseWrite
errors.Is(err, conv.ErrInvalidModelConversion) ||
errors.Is(err, &conv.ErrModelConversion{}) {
return armrpc_rest.NewBadRequestResponse(err.Error()), nil
} else if err != nil {
return nil, err
}

if newResource.Properties.Kind != datamodel.AzureCredentialKind {
Expand Down

0 comments on commit 4d4a3b2

Please sign in to comment.