Comments (3)
In case of errors the library raises LinodeException, where error code is set to the exception code. So, you can wrap your calls into try-catch blocks like below:
use Linode\LinodeApi;
use Linode\LinodeException;
use Linode\PaymentTerm;
// Create new linode.
try {
$api = new LinodeApi('tbd');
$res = $api->create(3, 1, PaymentTerm::ONE_MONTH);
printf("Linode #%d has been created.\n", $res['LinodeID']);
}
catch (LinodeException $e) {
printf("Error #%d: %s.\n", $e->getCode(), $e->getMessage());
}
I have also updated the project's README. Please let me know whether it helps.
from linode-api3.
perfect! thank you and please continue the great work!
from linode-api3.
Happy to help!
from linode-api3.
Related Issues (7)
- List all linodes and associated public ip address HOT 3
- Fatal error: Uncaught exception 'RuntimeException' with message 'Empty response' HOT 5
- does curl use the system or php timeout timeout value? HOT 2
- how can I get he linode's public ipv6 address? HOT 3
- any plans for api v4 support? - thanks! HOT 2
- Linode API SSL upgrade - library no longer works out of the box HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linode-api3.