Skip to content

DBC22-6337: return populated list and log errors when exception thrown#1314

Merged
wmuldergov merged 1 commit into
mainfrom
bugfix/DBC22-6337
May 13, 2026
Merged

DBC22-6337: return populated list and log errors when exception thrown#1314
wmuldergov merged 1 commit into
mainfrom
bugfix/DBC22-6337

Conversation

@bcgov-brwang
Copy link
Copy Markdown
Collaborator

@bcgov-brwang bcgov-brwang commented May 4, 2026

📝 Submitter

🔗 JIRA Ticket


✅ Quality Assurance & Requirements

  • Requirements Met: I have confirmed that all acceptance criteria from the JIRA ticket are fulfilled.
  • Tested desktop in local or dev envs
  • Tested mobile in local or dev envs
  • Ran unit tests locally
  • SonarCloud: I have verified that the SonarCloud analysis is clean/passing for this branch.

⚙️ Configuration & Environment

  • New Env Variables: Does this PR require new environment variables? (Yes/No)

    If yes, please list them here and ensure they are added to secret manager, the .env.example. and the Vault by an STA.

🧪 How to Test (if required)

  1. Go to tasks pod, execute command: . /vault/secrets/secrets.env && python manage.py populate_hef
  2. Verify no errors reported

🔍 Reviewer Checklist

  • Reviewed code for logic and cleanliness
  • Re-tested desktop/mobile in local or dev envs
  • Verified no new console warnings/errors
  • Confirmed that any new env variables are understood/documented

@bcgov-brwang bcgov-brwang changed the title DBC22-6337: return empty list instead of Response when exception happens DBC22-6337: return empty list instead of Response when exception thrown May 5, 2026
@bcgov-brwang bcgov-brwang marked this pull request as ready for review May 5, 2026 14:52
@bcgov-brwang bcgov-brwang requested a review from wmuldergov May 5, 2026 14:53
@wmuldergov
Copy link
Copy Markdown
Collaborator

Question, so if the source API is returning an error, it will now presume a []. The problem with that is that I assume all HEF entries will be removed correct? If that is the case, we don't actually want that behavior. If source API is unable, just log an error but do not assume [].

@bcgov-brwang
Copy link
Copy Markdown
Collaborator Author

Question, so if the source API is returning an error, it will now presume a []. The problem with that is that I assume all HEF entries will be removed correct? If that is the case, we don't actually want that behavior. If source API is unable, just log an error but do not assume [].

Right, returning an empty list should not be a proper way to handle this, I've updated the code to return the json object populated, just log the error happend.

Copy link
Copy Markdown
Collaborator

@wmuldergov wmuldergov left a comment

Choose a reason for hiding this comment

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

Can you revert the test back to testing what happens in case of an API failure.
Also can you fix the sonarcloud failures?

@bcgov-brwang
Copy link
Copy Markdown
Collaborator Author

Can you revert the test back to testing what happens in case of an API failure. Also can you fix the sonarcloud failures?

Done

@bcgov-brwang bcgov-brwang changed the title DBC22-6337: return empty list instead of Response when exception thrown DBC22-6337: return populated list and log errors when exception thrown May 12, 2026
DBC22-6337: updated test case

DBC22-6337: fixed scope error

DBC22-6337: just log the error instead of returning empty list

DBC22-6337: fixed sonarcloud alerts
@sonarqubecloud
Copy link
Copy Markdown

@wmuldergov wmuldergov merged commit 0011cd1 into main May 13, 2026
12 checks passed
@wmuldergov wmuldergov deleted the bugfix/DBC22-6337 branch May 13, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review The PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants