To throw authentication exception (HTTP 403)
use
throw new AuthException('Please login to continue');
To throw not found exception (HTTP 404)
use
throw new NotFoundException();
use
throw new AuthException('Please login to continue');
use
throw new NotFoundException();