afb-api-so: fix a bug in error detection