onErr(...) function returns true when err is defined.