Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception has been caught and custom error implemented while processing the Rest API via cmdlet #180

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

venmuthu
Copy link
Contributor

Exception has been caught and custom error implemented while processing the Rest API via cmdlet. If the error notification is not as per the desired JSON format, then validation has been done and custom exception implemented

…ng the Rest API. If the error notification is not as per the desired JSON format, then validation has been done and custom exception implemented
@venmuthu venmuthu requested a review from pyashish March 16, 2022 16:41
}
catch {

$errorMsg = "Invalid JSON format. Unable to parse the JSON string..."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message could be better. Developer needs to understand what the error is, Can you print the response ?
"Unable to read incoming request from server" : $Response

Also test these scenarios:

  1. API which returns Error
  2. Try API which is not in the system
  3. the powershell lint is failing on unrelated error, can you fix that ?

unknown added 2 commits March 17, 2022 15:05
The following PR comments incorporated
Customer error description modified
Log path included in the custom error
Priting both custom error and valid error response from the backend
Alignment done to avoid pester script validation errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants