addressing PR comments: added ability to pass Resource to getError and getErrno