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

Improve error-handler to accommodate for ErrorDetails and non-JSON/HTML responses #277

Merged

Conversation

hmmwhatsthisdo
Copy link
Contributor

Description

This PR modifies Invoke-JiraMethod to improve error-parsing under certain conditions.

More specifically, the following changes have been made:

Motivation and Context

If Jira (or the web server/proxy used to access it) is using Chunked transfer encoding, for instance, this field may not be populated (see this PowerShell UserVoice post).

This PR resolves #276.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have added Pester Tests that describe what my changes should do.
  • I have updated the documentation accordingly.

@hmmwhatsthisdo hmmwhatsthisdo requested review from a team as code owners May 31, 2018 21:38
@ghost ghost added the Status:In Review label May 31, 2018
@hmmwhatsthisdo
Copy link
Contributor Author

hmmwhatsthisdo commented May 31, 2018

One of the things that may need additional refinement (probably in a separate PR) is how to handle non-JSON/HTML error responses.

For instance, this behemoth is spat out of the API if invalid credentials are passed to New-JiraSession. It seems to be a mixture of JavaScript and plain-text, which isn't a particularly easy thing to parse without resorting to regexes or something more hamfisted. Apparently this is/was due to Test-ServerResponse not being called appropriately following edge-case exception behavior during login.

@hmmwhatsthisdo
Copy link
Contributor Author

@lipkau The New-JiraVersion integration tests appear to be 400ing - FWICT this can be caused by trying to create an issue where one with the same name already exists. Can you verify whether this is the case on the integration-test instance?

@ghost ghost assigned lipkau Jun 2, 2018
@lipkau lipkau merged commit 6df414b into AtlassianPS:develop Jun 2, 2018
@ghost ghost removed the Status:In Review label Jun 2, 2018
@hmmwhatsthisdo hmmwhatsthisdo deleted the ErrorDetails_ErrorHandlerFix-276 branch June 2, 2018 21:46
@lipkau lipkau added this to the v2.8 milestone Jun 27, 2018
@lipkau lipkau assigned hmmwhatsthisdo and unassigned lipkau Jun 27, 2018
@lipkau lipkau mentioned this pull request Jun 28, 2018
lipkau added a commit that referenced this pull request Jun 28, 2018
### IMPROVEMENTS

- Added support for paginated response from API server by means of `-Paging` (#291, [@lipkau[]])
- Added full set of functions to manage Filter Permissions (#289, [@lipkau[]])
- Added `-Id` parameter to `Remove-JiraFilter` (#288, [@lipkau[]])
- Changed logic of `Get-JiraUser` to return multiple results for a search (#272, [@lipkau[]])
- Added posts for homepage to the module's repository (#268, [@lipkau[]])
- Improved handling of _Credentials_ (#271, [@lipkau[]])
- Added missing interactions with _Filters_ (#266, [@lipkau[]])
- Added `Remove-JiraIssue` (#265, [@hmmwhatsthisdo[]])
- Improved Build script (to deploy changes to the homepage) (#259, [@lipkau[]])

### BUG FIXES

- Reverted `Add-JiraIssueAttachament` as JiraPS v2.7 broke it (#287, [@lipkau[]])
- Fixed resolving of Remote Link (#286, [@lipkau[]])
- Improved error handling for ErrorDetails and non-JSON/HTML responses (#277, [@hmmwhatsthisdo[]])
- Fully support Powershell v3 (#273, [@lipkau[]])
- Fixed parameter used in documentation but not in code (#263, [@lipkau[]])
lipkau added a commit that referenced this pull request Jun 29, 2018
### IMPROVEMENTS

- Added support for paginated response from API server by means of `-Paging` (#291, [@lipkau[]])
- Added full set of functions to manage Filter Permissions (#289, [@lipkau[]])
- Added `-Id` parameter to `Remove-JiraFilter` (#288, [@lipkau[]])
- Changed logic of `Get-JiraUser` to return multiple results for a search (#272, [@lipkau[]])
- Added posts for homepage to the module's repository (#268, [@lipkau[]])
- Improved handling of _Credentials_ (#271, [@lipkau[]])
- Added missing interactions with _Filters_ (#266, [@lipkau[]])
- Added `Remove-JiraIssue` (#265, [@hmmwhatsthisdo[]])
- Improved Build script (to deploy changes to the homepage) (#259, [@lipkau[]])

### BUG FIXES

- Reverted `Add-JiraIssueAttachament` as JiraPS v2.7 broke it (#287, [@lipkau[]])
- Fixed resolving of Remote Link (#286, [@lipkau[]])
- Improved error handling for ErrorDetails and non-JSON/HTML responses (#277, [@hmmwhatsthisdo[]])
- Fully support Powershell v3 (#273, [@lipkau[]])
- Fixed parameter used in documentation but not in code (#263, [@lipkau[]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants