ApplicationInsights-PHP icon indicating copy to clipboard operation
ApplicationInsights-PHP copied to clipboard

Feature to swallow all errors, or just specific errors

Open MichelZ opened this issue 6 years ago • 0 comments

We have hit the daily cap limit, and AI bombs out with:

PHP Fatal error: Uncaught exception 'GuzzleHttp\\Exception\\ClientException' with message 'Client error: POST https://dc.services.visualstudio.com/v2/trackresulted in a439 Daily quota exceeded response:\n{"itemsReceived":4,"itemsAccepted":0,"errors":[{"index":0,"statusCode":439,"message":"Daily quota exceeded"},{"index":1, (truncated...)\n' in /var/app/current/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:107\nStack trace:\n#0 /var/app/current/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\\Exception\\RequestException::create(Object(GuzzleHttp\\Psr7\\Request), Object(GuzzleHttp\\Psr7\\Response))\n#1 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Response))\n#2 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\\Promise\\Promise::callHandler(1, Object(GuzzleHttp\\Psr7\\Response), Array)\n#3 /var/app/current/vendor/guzzlehttp/promises/src/TaskQueue.php(61): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\ in /var/app/current/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 107

It would be nice if we can make AI to ignore either all exceptions, or specific one's. I don't think it's good if "logging code" throws errors by default.

MichelZ avatar Oct 10 '18 08:10 MichelZ