Comments (5)
Sorry but this does not belong to the library. It should be more on the application side instead here.
from apai-io.
So what you're saying is that it's up to me to write some kind of error handling procedure for your code?
[16-Jan-2015 12:51:44 GMT] PHP Fatal error: Uncaught SoapFault exception: [aws:Server.InternalError] We encountered an internal error. Please try again. in /home/_/public_html/__Apai-IO/vendor/exeu/apai-io/lib/ApaiIO/Request/Soap/Request.php:152
Stack trace:
#0 /home//public_html/__Apai-IO/vendor/exeu/apai-io/lib/ApaiIO/Request/Soap/Request.php(152): SoapClient->__soapCall('BrowseNodeLooku...', Array)
#1 /home/**/public_html/__Apai-IO/vendor/exeu/apai-io/lib/ApaiIO/Request/Soap/Request.php(67): ApaiIO\Request\Soap\Request->performSoapRequest(Object(ApaiIO\Operations\BrowseNodeLookup), Array)
#2 /home/_/public_html/__Apai-IO/vendor/exeu/apai-io/lib/ApaiIO/ApaiIO.php(73): ApaiIO\Request\Soap\Request->perform(Object(ApaiIO\Operations\BrowseNodeLookup))
#3 /home//public_html/**/amazonNodes/config.php(81): ApaiIO\ApaiIO->runOperation(Object(ApaiIO\Operations\BrowseNodeLookup))
#4 /home/**/public_html/_/_amazonNodes/03_UpdateChildNodes.php(59): _BrowseAmazon('12306')
#5 /home//public_html/**/amazonNodes/03 in /home/***/public_html/__Apai-IO/vendor/exeu/apai-io/lib/ApaiIO/Request/Soap/Request.php on line 152
from apai-io.
no you write a error handling procedure which covers your problems, which both caused by Aws and/or some connection problems of your server ;)
from apai-io.
Just wanted to share this in case anyone else has the same issue.
I changed from SOAP to REST.
I edited the "Rest" Request.php file and added (Somewhere around line 162):
if (false == $result) {
$limit = 0;
while((curl_errno($ch) == 7 or curl_errno($ch) == 28 or $limit = 0) and $limit < 6)
{
sleep (5);
$result = curl_exec($ch);
$limit++;
}
}
I will include more of the surrounding code so that others will be able to find where to add it easily:
$curlError = false;
$errorNumber = null;
$errorMessage = null;
$result = curl_exec($ch);
/* Added */
if (false == $result) {
$limit = 0;
while((curl_errno($ch) == 7 or curl_errno($ch) == 28 or $limit = 0) and $limit < 6)
{
sleep (5);
$result = curl_exec($ch);
$limit++;
}
}
/* End of Added */
if (false === $result) {
$curlError = true;
$errorNumber = curl_errno($ch);
$errorMessage = curl_error($ch);
}
curl_close($ch);
from apai-io.
Having the error handling inside the API library itself is easier than having to implement it at the application level.
I would prefer for this code to be more parametric, allowing the number of retries to be determined, either by configuration or by function call parameter. As well, the use of a known Exception type would be ideal, so the application can be coded to handle the permanent fail condition, rather than a simple retry.
The fact is, that any application which needs to connect to the Amazon API will at some point encounter these exceptions. I've even seen it happen on AWS EC2 machines, which have a very good uptime and are part of Amazon's own infrastructure. We should think of this as an expected scenario rather than an odd edge case.
That being the case, it would be nicer for retry to be part of the library itself. Why have everyone reinvent the wheel, when a standard implementation for needed code can be provided?
from apai-io.
Related Issues (20)
- AWS.Invalid (truncated...) HOT 5
- SignatureDoesNotMatch HOT 2
- Search for ASIN HOT 3
- 400 Bad Request - Request has expired HOT 1
- when no category defined, no results
- condition = 'used' should be 'Used'
- Question: Catching errors HOT 1
- Restricting "Similar" Results by Node
- how to use without composer? HOT 1
- GuzzleHttp\Exception\ServerException HOT 2
- Detailed Release Notes HOT 1
- amazon country
- Dynamically Insert Value base on User Request
- why does setPage have a limit of 10?
- Error 503 Service Unavailable HOT 6
- Problem when using in two plugins at the same time
- Technical question
- Product Advertising API 5.0 HOT 29
- RequestException.php throwing an error? HOT 1
- Guzzle 5
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 apai-io.