Introduce (optional) exeception handling #343
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#343
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
According to this post https://stackoverflow.com/questions/5257190/are-exceptions-still-undesirable-in-realtime-environment and some research on the internet / watching videos by C++ experts, exceptions can be a useful tool for error handling. I think it would be a good idea to add (optional) exception support. A first way to check whether this is
feasible would be to monitor the code size. My guess is that the increase will be negligible
and on systems like a Q7S, the code size does not matter anyway.
I think one useful place to use it would be catching
std::bad_alloc
exceptions. Nobody checks the resulting pointer of anew
operation in the factory and it would be too much of a hassle anyway. Exceptions are a very convenient way to handle issues which are configuration errors or just "should not happen" and I found them extremely useful and superior to returncodes in Python.Another useful example would be to throw
std::invalid_argument
https://en.cppreference.com/w/cpp/error/invalid_argument if there are issues at initializatin time, which would allow developers to move initialization code to the constructor and catch configuration errors via exception.