Throw 404 exception if empty method.