function handling errors and exceptions, as it can't read the right value of the global obi_errno (Cython configuration problem?)