azure-sdk-for-js: [swagger]containerApps.listSecrets throws response code 204 as an error

Describe the bug client.containerApps.listSecrets considers the 204 response code to be an error. This happens if the container app pinged has no secrets associated with it. It should probably just return an empty array rather than throwing an error.

To Reproduce Steps to reproduce the behavior:

  1. Call client.containerApps.listSecrets on a container app that has no secrets

Expected behavior If the container app has a secret, return the array. If it does not, return an empty array.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Verified that this is fixed. Thanks!

@nturinski we reproduced the errors in local and these two deletions are identified as client errors. We are working on the fixes and will let you know once ready!

Please notice this error is different from the one in client.containerApps.listSecrets which is a swagger issue we need to work with service team to fix.

@nturinski Yes, you are right and this is re-named package. Please edit your first comment to reflect them. Thanks!

@nturinski Hi Nathan, thanks for reporting this and the first one is identified as a swagger issue and the swagger definition didn’t take 204 as success status code into consideration and we contacted the service team and they would fix the swagger then we’ll release a new version.

For the operation client.containerApps.listSecrets, it will throw the RestError with 204 header

This is unexpected behavior. 204 means it is an empty (no content) response and shouldn’t be considered an error. You will get this response if your container app doesn’t contain any secrets.

For the operation containerApps.beginDeleteAndWait, it will return undefined and NOT throw any error with 204 header

This is expected behavior and is great!