Handle AccessDenied exception in sampler().