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

Fix: Jira add detailed error message #1240

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions JIRA/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 2025-01-06 - 1.3.0

### Changed

- Add details to error message in case of Jira API error

## 2024-05-28 - 1.2.0

### Changed
Expand Down
4 changes: 4 additions & 0 deletions JIRA/jira_modules/action_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
def _handle_response_error(self, response: requests.Response):
if not response.ok:
message = f"Request to JIRA API failed with status {response.status_code} - {response.reason}"
if response.status_code == 400:
data = response.json()
detailed_errors = data.get("errorMessages", [response.text])
message = f"{message}: \n {','.join(detailed_errors)}"

Check warning on line 61 in JIRA/jira_modules/action_base.py

View check run for this annotation

Codecov / codecov/patch

JIRA/jira_modules/action_base.py#L59-L61

Added lines #L59 - L61 were not covered by tests

self.log(message=message, level="error")
response.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion JIRA/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"uuid": "d1445e5e-8e3b-417f-ae19-bca67a10affd",
"name": "Atlassian JIRA",
"slug": "atlassian-jira",
"version": "1.2.0",
"version": "1.3.0",
"description": "Integrates with JIRA",
"configuration": {
"title": "JIRA",
Expand Down
Loading