Giter Site home page Giter Site logo

coconutphp's People

Contributors

brunoceleste avatar flug avatar lifeofguenter avatar mibstar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coconutphp's Issues

throw better exceptions

Currently API error codes are included as string at the end of the \Coconut\Error::message property. It would be more convenient to add an api_error_code property on the exception class, so it can easily be inspected to the php code using this library and each error can be handled differently if needed.

Deprecation warning on PHP 8.2

Creation of dynamic property Coconut\Client::$metadata is deprecated in /www/html/vendor/opencoconut/coconut/src/Client.php on line 31

code:

$this->api = new API($this);
$this->job = new Job($this);
$this->metadata = new Metadata($this);

Throw better exceptions for `api_usage_exceeded` error

The coconut API returns a 403 HTTP status code when the usage limit is exceeded. This throws a genericCoconut\Error, which does not provide much information to the php code using this library.

Ideally, the error message and error code would be part of the exception thrown so it can be displayed to the end user, or the exception can be handled differently (for example: retrying the API call after a delay?).

This does not autoload under composer

Unfortunately this does not autoload under composer

$job = Coconut_Job::create($config);

Just comes back with cant find class Coconut_Job

Suggest putting the two classes in separate files and perhaps name space them

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.