[native] better error reporting with c modules