Giter Site home page Giter Site logo

Lib does not return exception about php-sdk HOT 8 CLOSED

eerison avatar eerison commented on July 17, 2024
Lib does not return exception

from php-sdk.

Comments (8)

kvz avatar kvz commented on July 17, 2024

And there also is no other way to detect this failure? Does the function return an error (string) perhaps?

from php-sdk.

eerison avatar eerison commented on July 17, 2024

Yes I can get this error as string and this message Could not resolve host: api2.transloadit.com I got from

$transloadit->createAssembly

But is better you use Exception to manager errors ...

What I was thinking ....

Default Exception

class TransloaditException extends Exception {}

Into createAssembly

public function createAssembly()
{
  try {
        ...... your logic
   catch(\Exception $exception) {
        throw new TransloaditException()
    }
}

When you need to use the createAssembly method

  try {
        $transloadit->createAssembly()
   catch(TransloaditException $exception) {
       you do something .....
    }

from php-sdk.

kvz avatar kvz commented on July 17, 2024

There was a time that folks were skeptical about using exceptions in PHP but i gauge that time is well behind us now. I'm open to this change, if @tim-kos is too, but likely we don't have the time to do this anytime soon, would you be open to PRing @eerison?

from php-sdk.

eerison avatar eerison commented on July 17, 2024

Sure @kvz I'm forking your project and start to contribute with your project!

from php-sdk.

tim-kos avatar tim-kos commented on July 17, 2024

Yep sounds good! Looking forward to your PR!

from php-sdk.

kvz avatar kvz commented on July 17, 2024

Is this something you'd still like to attack @eerison or should we close the issue?

from php-sdk.

eerison avatar eerison commented on July 17, 2024

I think it's good to continue open, to help to track what we need to do

from php-sdk.

eerison avatar eerison commented on July 17, 2024

it will be resolved in this Pull request: #34

from php-sdk.

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.