Skip to content

Swallow exceptions in getCases() when some cases do not have case_metadata#67

Merged
etiennehomer merged 18 commits intomainfrom
swallow_crashes_in_getCases
Feb 18, 2025
Merged

Swallow exceptions in getCases() when some cases do not have case_metadata#67
etiennehomer merged 18 commits intomainfrom
swallow_crashes_in_getCases

Conversation

@etiennehomer
Copy link
Collaborator

@etiennehomer etiennehomer commented Feb 13, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
Changes the behavior of the getCases() method

Does this PR introduce a new Powsybl Action implying to be implemented in simulators or pypowsybl?

  • Yes, the corresponding issue is here
  • No

What is the current behavior?
While executing getCases(), if a case is present on the filesystem but not referenced in the case_metadata database, the method throws an exception and returns a 404.

What is the new behavior (if this is a feature change)?
In such a case, getCases() will return the cases list without the cases non present in the case_metadata db. The error will be logged.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
@etiennehomer etiennehomer force-pushed the swallow_crashes_in_getCases branch from 1a1acae to 6a41f57 Compare February 14, 2025 16:22
etiennehomer and others added 6 commits February 14, 2025 17:27
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
Signed-off-by: Etienne <etiennehomer@gmai.com>
fix
Signed-off-by: Etienne <etiennehomer@gmai.com>
fix
Signed-off-by: Etienne <etiennehomer@gmai.com>
Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
@etiennehomer etiennehomer changed the title Swallow crashes in getCases() Swallow crashes in getCases() when some cases do not have case_metadata Feb 17, 2025
@etiennehomer etiennehomer changed the title Swallow crashes in getCases() when some cases do not have case_metadata Swallow exceptions in getCases() when some cases do not have case_metadata Feb 17, 2025
@EtienneLt
Copy link
Collaborator

test OK

Copy link
Collaborator

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

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

Code OK
Test OK

Signed-off-by: Etienne Homer <etiennehomer@gmail.com>
@sonarqubecloud
Copy link

@etiennehomer etiennehomer merged commit b216754 into main Feb 18, 2025
5 checks passed
@etiennehomer etiennehomer deleted the swallow_crashes_in_getCases branch February 18, 2025 10:20
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.

3 participants