phaynes
(Phaynes)
February 13, 2024, 4:11pm
1
I am playing around with some error handling on accessing and downloading a sharepoint file and I have the following arguments:
I create a list and add all of these arguments to said list:
Later, I use a for each through each of these arguments in the list and check if their value is still the default value set. If so, it adds each variable with an error to an exception list:
This list is then concatenated at the end and printed out, however the list prints the error variable contents, how can I get it to print the name?
My code for this:
The resulting string:
An example of what I want this to be:
Required argument in_SharepointAppID has default value still set. Please make sure this value is being assigned an input argument.
Anil_G
(Anil Gorthi)
February 13, 2024, 4:30pm
2
@phaynes
Instead of list and variables separately…use dictionary…that way key will be the name and value will be the value you need
You cannot directly print a variable name…where you are passing only value in list and not the name
Cheers
postwick
(Paul Ostwick)
February 13, 2024, 5:12pm
3
Why don’t you just take the default values out and make the arguments required? This will force them to fill in those arguments.
phaynes
(Phaynes)
February 13, 2024, 5:26pm
4
Completely forgot this was even something I could do. This is my solution.
1 Like
system
(system)
Closed
February 16, 2024, 5:27pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.