use ErrResourceNotFound instead of nil-checking

[#84359170]

Signed-off-by: Atul Kshirsagar <atul.kshirsagar@gmail.com>