Git Product home page Git Product logo

Comments (7)

its-clee avatar its-clee commented on July 21, 2024

Hello,

As you pointed out 404 response is expected when a DELETE request is performed on an object that doesn't exist. I'd suggest you wrap the delete call with a try/catch block.

The unit test expects the delete operation to be successful. I wanted the test to fail if the delete operation is not successful. Sorry about the confusion though.

Cheers!

from softlayer-object-storage-php.

jjriv avatar jjriv commented on July 21, 2024

Thanks for getting back to me and for the confirmation. I went ahead and wrapped the delete call, along with all other calls to ObjectStorage, inside a try/catch block. This way it won't cause a fatal error within my web application. One last question. Once I've caught the 404, or whatever the exception might be, is there a way to get the status code that was received? Something like $e->getStatusCode() where $e is an Exception object?

from softlayer-object-storage-php.

its-clee avatar its-clee commented on July 21, 2024

I think the ability to get the HTTP code from an exception is a great idea. I will implement the exception code for all HTTP exception sub classes so you can use $e->getCode(). Also, I will update all ObjectStorage_Exception_Http_* classes to implement ObjectStorage_Exception_Http_Interface so you can expect the HTTP status code when you're catching these exceptions.

from softlayer-object-storage-php.

jjriv avatar jjriv commented on July 21, 2024

Wow! That would be very helpful. Thanks! I'll look forward to the update.

from softlayer-object-storage-php.

its-clee avatar its-clee commented on July 21, 2024

HTTP exceptions will have the status code now.

Cheers!

from softlayer-object-storage-php.

CrackerJackMack avatar CrackerJackMack commented on July 21, 2024

Probably needs docs in the README

from softlayer-object-storage-php.

briancline avatar briancline commented on July 21, 2024

Going ahead and closing this since it looks like it was resolved with c65981b. Thanks!

from softlayer-object-storage-php.

Related Issues (19)

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.