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

osrdyne: exit if the provided configuration file doesn't exist #9144

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

leovalais
Copy link
Contributor

@leovalais leovalais commented Oct 1, 2024

Yaml::file_exact fails if the path doesn't point to a file.
Yaml::file does not (by design).

Yet another "what is wrong with my setup again?" and its just osrdyne.yml instead of osrdyne.yaml...

@leovalais leovalais requested a review from a team as a code owner October 1, 2024 17:48
@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.18%. Comparing base (91021c9) to head (390e639).
Report is 1 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #9144      +/-   ##
============================================
- Coverage     37.19%   37.18%   -0.01%     
  Complexity     2242     2242              
============================================
  Files          1263     1263              
  Lines        116087   116087              
  Branches       3278     3278              
============================================
- Hits          43174    43169       -5     
- Misses        70959    70964       +5     
  Partials       1954     1954              
Flag Coverage Δ
core 74.80% <ø> (ø)
editoast 72.31% <ø> (-0.02%) ⬇️
front 15.29% <ø> (ø)
gateway 2.22% <ø> (ø)
osrdyne 2.56% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Khoyo
Copy link
Contributor

Khoyo commented Oct 1, 2024

But I am appalled that Yaml::file_exact() panics instead of reporting an error...

`Yaml::file_exact` fails if the path doesn't point to a file.
`Yaml::file` does not (by design).

Signed-off-by: Leo Valais <leo.valais97@gmail.com>
@leovalais leovalais force-pushed the lva/osrdyne-config-file-no-such-file branch from ae3a9d3 to 390e639 Compare October 1, 2024 19:46
@leovalais leovalais changed the title osrdyne: panic if the provided configuration file doesn't exist osrdyne: exit if the provided configuration file doesn't exist Oct 1, 2024
@leovalais
Copy link
Contributor Author

It does not panic but since the error is propagated up to the main() invocation the result is just like a panic. I reworded the commit as I can see how misleading the description was...

@leovalais leovalais added this pull request to the merge queue Oct 1, 2024
Merged via the queue into dev with commit 9f74ec1 Oct 1, 2024
23 checks passed
@leovalais leovalais deleted the lva/osrdyne-config-file-no-such-file branch October 1, 2024 20:10
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