BlueBrain / BlueBrain/nexus-forge
Propagating exceptions from executed actions
- Dominant language
- Python
- Stars
- 52
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
### Issue
I noticed that whenever an action fails, regardless of the cause, the exception is always silenced and logged with a simple `print`. I traced the implementation and found that this behaviour is controlled by the following logic:
#### Current API
The exceptions are only re-raised if the following conditions are met:
https://github.com/BlueBrain/nexus-forge/blob/8a900ecf191b14490e7c85254d2c41cf2ec5c8a6/kgforge/core/commons/execution.py#L170-L171
I traced the code and the `catch_exceptions` flag is set to `True` by default:
https://github.com/BlueBrain/nexus-forge/blob/8a900ecf191b14490e7c85254d2c41cf2ec5c8a6/kgforge/core/commons/execution.py#L110-L113
And there seems to be no way to change it's value, since the public API of the `Store` does not allow for this argument to be passed, for example:
https://github.com/BlueBrain/nexus-forge/blob/8a900ecf191b14490e7c85254d2c41cf2ec5c8a6/kgforge/core/archetypes/store.py#L99-L112
Is there something I'm missing or is there currently no way to allow the exceptions to propagate normally? Is this a conscious decision? I found that https://github.com/BlueBrain/nexus-forge/pull/281 adds a way to manipulate this behaviour, although only for "debug" purposes and the PR is not merged.
Contributor guide
Assessment
This issue has not been assessed yet.