Set *err before *err_info - that's how it's done in most other modules.