Skip to content

fix no contingency list exception#243

Merged
EtienneLt merged 4 commits into
mainfrom
fix-no-contingency-list-exception
May 18, 2026
Merged

fix no contingency list exception#243
EtienneLt merged 4 commits into
mainfrom
fix-no-contingency-list-exception

Conversation

@EtienneLt
Copy link
Copy Markdown
Contributor

PR Summary

if an illegal exception is thrown the error is 'there is no contingency list'. So to avoid to hide exceptions, a new exception AllContingencyListMissingException is created and caught.

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@EtienneLt EtienneLt self-assigned this May 18, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

Warning

Rate limit exceeded

@EtienneLt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 17 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82c0458c-a3f8-4706-95a4-1f4bb5ef9067

📥 Commits

Reviewing files that changed from the base of the PR and between ed9ad4e and 75a2ee7.

📒 Files selected for processing (1)
  • src/test/java/org/gridsuite/securityanalysis/server/service/ActionsServiceTest.java
📝 Walkthrough

Walkthrough

This PR adds AllContingencyListMissingException and uses it: ActionsService throws it when contingency-list IDs are null/empty; SecurityAnalysisWorkerService catches it and converts it to SecurityAnalysisException. Tests updated to assert the new exception and message.

Changes

Contingency List Exception Refactoring

Layer / File(s) Summary
Define exception class
src/main/java/org/gridsuite/securityanalysis/server/error/AllContingencyListMissingException.java
New public AllContingencyListMissingException extending IllegalArgumentException with a single String constructor.
Apply exception in services and tests
src/main/java/org/gridsuite/securityanalysis/server/service/ActionsService.java, src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisWorkerService.java, src/test/java/org/gridsuite/securityanalysis/server/service/ActionsServiceTest.java
Adds imports and updates ActionsService.getContingencyList(...) to throw AllContingencyListMissingException for null/empty ids; updates SecurityAnalysisWorkerService.preRun to catch that exception and rethrow SecurityAnalysisException; updates tests to assert the new exception and message and refactors some imports/formatting.

Suggested Reviewers

  • thangqp
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix no contingency list exception' directly summarizes the main change: introducing a new exception type to properly handle the contingency list missing scenario instead of hiding it with a generic IllegalArgumentException.
Description check ✅ Passed The description clearly explains the rationale for the change: creating a new AllContingencyListMissingException to avoid hiding exceptions when a contingency list is missing, which directly relates to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

EtienneLt added 3 commits May 18, 2026 15:02
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@sonarqubecloud
Copy link
Copy Markdown

@EtienneLt EtienneLt requested a review from etiennehomer May 18, 2026 13:28
@EtienneLt EtienneLt merged commit c6766fb into main May 18, 2026
4 checks passed
@EtienneLt EtienneLt deleted the fix-no-contingency-list-exception branch May 18, 2026 13:43
EtienneLt added a commit that referenced this pull request May 21, 2026
---------

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
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.

2 participants