France-ioi / AlgoreaBackend

Backend for the new Algorea platform
MIT License
1 stars 2 forks source link

Fix a panic in DB.inTransactionWithCount() when it recovers an error that doesn't implenent error interface #1127

Closed zenovich closed 1 month ago

zenovich commented 1 month ago

For instance, when DB.inTransactionWithCount() recovers a string it panics without re-throwing the caught error. (This is a partial reversion of https://github.com/France-ioi/AlgoreaBackend/commit/9639e4420dbd95f2d4814be9b794176f89430917#diff-922f99fad48da0cadc4df22b0f8b52d267d1689e91ee413605ce5b741570adf6L116, fyi @GeoffreyHuck).

Here I fix the issue and add a test.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (27c25aa) to head (5032611).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1127 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 238 238 Lines 14450 14451 +1 ========================================= + Hits 14450 14451 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.