Skip to content

Commit

Permalink
Return error if create credential request is not a bad request (#4874)
Browse files Browse the repository at this point in the history
# Description

_Please explain the changes you've made._

## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Fixes: #issue_number

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [x] Code compiles correctly
* [ ] Adds necessary unit tests for change
* [ ] Adds necessary E2E tests for change
* [x] Unit tests passing
* [ ] Extended the documentation / Created issue for it

Co-authored-by: Bharath Joginapally <[email protected]>
  • Loading branch information
2 people authored and mishrapratikshya committed Feb 1, 2023
1 parent c74db03 commit bd8289b
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 bd8289b

Please sign in to comment.