aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
411 stars 184 forks source link

Engine: Improve error message when submitting without broker #6465

Closed sphuber closed 1 day ago

sphuber commented 3 weeks ago

Fixes #6374

The aiida.engine.launch.submit method was just raising a vague AssertionError in case the runner did not have a communicator, which is the case if it was constructed without a communicator which in turn happens for profiles that do not configure a broker.

Since profiles without brokers are now supported and users are bound to try to submit anyway, the error message should be clearer.

sphuber commented 3 weeks ago

Perhaps the error message would be even better with a link to the docs which gives even more background information and tells users how they can configure the broker. That would require #6455 to be merged before that, because currently those docs don't exist yet.

Still, I am always a bit hesitant to add docs links in error messages since they can easily go stale. I know that SQLalchemy solves this somewhat by using shortened urls the referent of which can then be updated with redirects in case the documentation links change.

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 77.83%. Comparing base (ef60b66) to head (351c671). Report is 49 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6465 +/- ## ========================================== + Coverage 77.51% 77.83% +0.33% ========================================== Files 560 561 +1 Lines 41444 41768 +324 ========================================== + Hits 32120 32506 +386 + Misses 9324 9262 -62 ``` | [Flag](https://app.codecov.io/gh/aiidateam/aiida-core/pull/6465/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam) | Coverage Δ | | |---|---|---| | [presto](https://app.codecov.io/gh/aiidateam/aiida-core/pull/6465/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam) | `73.17% <100.00%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#carryforward-flags-in-the-pull-request-comment) to find out more.

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