iceoryx
iceoryx copied to clipboard
Refactor all posix wrapper with better error handling
Brief feature description
At the moment the posix wrapper have a very detailed and unnecessary error handling. We should refactor the following aspects of the posix wrapper.
- Misuse of posix functions through wrong arguments or wrong call order is handled by the abstraction via enum classes or contract by design.
- a
cxx::expected
should be replaced withcxx::Ensures
when the failure can only be caused by system corruption. For instance when someone outside of the program removed the shared memory handle withrm -rf /dev/shm/my_shared_memory
.
The first aspect would reduce the error handling since it is much harder to misuse the posix wrapper through wrong options. The second aspect would reduce it even further and in my opinion it is no longer the task of the application to handle a corrupted system. When this is detected we should only terminate.
@elBoberido what do you think?
I like it