Code Monkey home page Code Monkey logo

Comments (5)

simonbuchan avatar simonbuchan commented on June 24, 2024

v2 correctly handles the response (with a few more internal exceptions than I'd like), but it is currently a pain for users to actually handle the response: catching AmazonS3Exception and checking ErrorCode == "NotModified" seems to be the only way to handle it currently, and it doesn't look like ErrorCode values are documented (perhaps falling back to the REST api docs?).

I would like to see some form of explicit handling of NotModified, preferably in an exception-free path (to make first-chance exception debugging less of a pain in the ass).

I notice that NotFound is similarly not explicitly handled, which is weird: being able to get an object or metadata if it exists seems like it should be common?

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

Thanks for this suggestion.
Making this change outright will be a breaking change for users who are expecting this exception, but we will consider a mechanism to support this that may be opt-in.

Can you clarify the last sentence of your last message regarding the handling of NoutFound?

from aws-sdk-net.

simonbuchan avatar simonbuchan commented on June 24, 2024

From my reading of my comment 5 months ago, it looks like I was saying it makes sense to also have an explicit not found exception and/or an exception-free path for 404 responses. That is, it should be possible to try to get an S3 object and handle it not being there without catching an exception. Preferably not throwing any first-chance exceptions, as that makes debugging significantly less annoying (with things like ELMAH, breaking on uncaught exceptions might not be easy to get working)

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

Thanks for the follow-up. The V2 SDK already has some of this logic, to not throw on 404s in some cases, but we will be working to extend this. Will update this issue when we add this functionality.

from aws-sdk-net.

normj avatar normj commented on June 24, 2024

Closing this for lack of activity

from aws-sdk-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.