Updated error handling for ONE backend

check_retval now takes the 'e_klass' argument as a suggestion
and will force a different class when necessary (for well-known
errors)