Latest work

It is still pretty ugly, but at least with an integration test it seems to be doing its part.
Hello,
the name of this function and the way it behaves makes the reading of the code harder.
Either we rename it in `check_for_error` (or similarly, `has_error`) or we change the way it behaves.
From a function called `error_check` I'd expect a behavior similar to the `errno` handling in C.