-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw error when SP URL is null
#6012
Comments
yes we should 😉. |
Yes, that's the importance of |
It's a lot of work since this applies to every single option in every single command. The same thing will happen when you run The good news is, with the implementation of ZOD, this will all be fixed because every option will be typed automatically. So I suggest that we just deal with it right now. Otherwise, we have to fix this in 90% of all commands right now, and we still have to implement ZOD in every command, which will fix it anyway. So that's kind of (a lot of) double work. |
Can I work on it? |
While testing a command I used a variable to store my site URL so it didn't clutter my command args too much. However, I was getting a strange error as shown below:
This error was due to the fact that I made a typo and
--webUrl
wasnull
(because the variable I specified didn't exist).This is because the validator we are using is as follows:
cli-microsoft365/src/utils/validation.ts
Lines 349 to 360 in 3152fc7
In the command (and other commands) we validate it like this:
cli-microsoft365/src/m365/spo/commands/file/file-add.ts
Lines 139 to 142 in 3152fc7
Shouldn't we output an error message when the value is
null
? The current errorError: false
doesn't help at all.The text was updated successfully, but these errors were encountered: