-
Notifications
You must be signed in to change notification settings - Fork 797
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
Deployment validation and create does not return error #6125
Comments
as for this suggestion we can use this workaround although the error returned from the site you cannot be sure it is because of template or because you didn't send proper request for this it will be clear if the examples are updated to check for response error instead of relying on sdk trigger the error WDYT? Regards, |
A fix for this issue (if needed) will need the service team to come in. I have tagged this issue so the right team will see. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure |
@itavy is the issue that the SDK does not return an error? Or is that you can't distinguish between a poorly authored template and a malformed request because they both return 4xx? |
my issue was the fact i cannot distinguish between 2 cases; but this was not my initial problem, but the actual example sdk that is misleading so after investigating this a bit more there are 2 issues:
|
btw they return 400 code, not any 4xx code. for any other 4xx request except 400 it will rise an error |
We just had a discussion about this. You are right that the issue is in the autorest logic, but to make a change there would be a significant breaking change. Since you have a workaround to parse the error object to see if a 400 is present, we don't feel we need to make a breaking change like that at this time. We will take an action to update the example sdk that you linked to. We agree it is misleading. Once the example is updated, we will link to that in this issue. For distinguishing the 400s, that is again something we are not able to change at this time. When you submit a deployment via the API, the template itself is in the PUT body, so if there is something wrong with the template it is correctly being categorized as a bad request. You should be able to base your logic off of the error details that are returned. Does this all make sense? After your response I will close the issue. |
Hi,
Sorry for the late reply, i agree with your suggestion.
You can close the issue.
Regards,
Octavian
…On Mon, Oct 28, 2019, 20:15 Alex Frankel ***@***.***> wrote:
We just had a discussion about this.
You are right that the issue is in the autorest logic, but to make a
change there would be a significant breaking change. Since you have a
workaround to parse the error object to see if a 400 is present, we don't
feel we need to make a breaking change like that at this time.
We will take an action to update the example sdk that you linked to. We
agree it is misleading. Once the example is updated, we will link to that
in this issue.
For distinguishing the 400s, that is again something we are not able to
change at this time. When you submit a deployment via the API, the template
itself is in the PUT body, so if there is something wrong with the template
it is correctly being categorized as a bad request. You should be able to
base your logic off of the error details that are returned.
Does this all make sense? After your response I will close the issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6125?email_source=notifications&email_token=AAHQ7WMMZZ4V5AQSBD65ZODQQ4T5BA5CNFSM4JD6R3PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECN4GZY#issuecomment-547079015>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHQ7WOR4IG2UNE6LYFSVG3QQ4T5BANCNFSM4JD6R3PA>
.
|
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment. |
Bug Report
.../services/resources/mgmt/2018-05-01/resources
v34.2.0
go version
:i followed steps in example sdk to make a deployment
both
Validate
andCreateOrUpdate
methods of DeploymentClient return no error, although the site responds back with 400 status code:it seems the problem is this line
because it doesn't throw error in case of
Bad request
it seems it is related to definition in Azure Rest Api specs and autorest generator which treats all responses defined in api as expected responses and does not throw error
this behaviour is the same in other api versions
Thanks!
Octavian
The text was updated successfully, but these errors were encountered: