Giter Club home page Giter Club logo

Comments (5)

github-actions avatar github-actions commented on August 15, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

from azure-sdk-for-net.

heng-liu avatar heng-liu commented on August 15, 2024

Hi, @HarveyLink , fyi, the track1 SDK doesn't throw exceptions when "Preflight validation failed".

from azure-sdk-for-net.

welovej avatar welovej commented on August 15, 2024

hi @heng-liu

When working with Long-Running Operations (LROs) in the Azure SDK, the SDK typically throws an exception if a 400 response is returned by the service. This is intended to simplify error handling by treating non-successful HTTP responses as exceptions. However, this can be problematic if you need to handle 400 responses as non-exceptional cases, such as when you want to parse and process the validation result directly.

ARM Specification and Expected Behavior
According to Azure Resource Manager (ARM) specifications, LROs should not return a 400 status code as part of their standard operation flow. The expectation is that successful operations will return 200-series status codes, and failure scenarios will return appropriate status codes that are handled as exceptions. Due to this specification, the Azure SDK is designed to treat 400 responses as errors and throws exceptions accordingly.

Custom Handling Approach
To manage this, you can wrap the LRO call in a try-catch block and handle exceptions specifically for the 400 status code. This allows you to extract the necessary information from the response and handle it appropriately without treating it as an error.

Seeking Further Assistance
If the current SDK behavior does not fully meet your needs or requires more customization than you can implement, it is advisable to contact the Azure service team for further assistance. They can provide specific guidance or consider feature requests for future SDK updates. By reaching out to the service team, you can get specialized support and potentially influence future improvements in the SDK to better handle your scenarios.

from azure-sdk-for-net.

github-actions avatar github-actions commented on August 15, 2024

Hi @heng-liu. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

from azure-sdk-for-net.

github-actions avatar github-actions commented on August 15, 2024

Hi @heng-liu, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

from azure-sdk-for-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.