Return error if the queried object doesn't exist