Open TekuSP opened 3 years ago
This is to uncorrect rights set, but, error should be more clear for user to understand.
As you can see, the exception from the underlying API is not really telling me it's a user rights error.
The exception class is MethodInvocationException
and the exception message is "No agent found for pool 1 with identifier 13." That's all you have to work with. The error class is generic, and I don't like the idea of parsing an error message.
Can you call API to verify user gave you account/token with right permissions? https://docs.microsoft.com/en-us/rest/api/azure/devops/security/permissions/has%20permissions?view=azure-devops-rest-6.0
On general grounds, if a user is unable to read the properties of an agent, the same user won't be able to check the permissions on the agent, either. And this is all over a more descriptive error message.
I think I'll add a generic "Please check the permissions" to the message.