iceoryx icon indicating copy to clipboard operation
iceoryx copied to clipboard

Refactor all posix wrapper with better error handling

Open elfenpiff opened this issue 3 years ago • 2 comments

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.

  1. Misuse of posix functions through wrong arguments or wrong call order is handled by the abstraction via enum classes or contract by design.
  2. a cxx::expected should be replaced with cxx::Ensures when the failure can only be caused by system corruption. For instance when someone outside of the program removed the shared memory handle with rm -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.

elfenpiff avatar Jun 02 '21 19:06 elfenpiff

@elBoberido what do you think?

elfenpiff avatar Jun 02 '21 19:06 elfenpiff

I like it

elBoberido avatar Jun 02 '21 20:06 elBoberido