check NME return type and throw exception if non-0