Skip to content

Conversation

TaylorChen
Copy link

@TaylorChen TaylorChen commented Sep 27, 2024

In the use of Ali cloud logging sdk docking log, found that the local will appear “Object of class CurlHandle could not be converted to string” error prompt, after some troubleshooting, found that in requestcore. class.php file will be encountered when the curl return to empty is false, at this time on the return of the curl_handle object for string conversion, in the conversion of the following error. But for the business code for this fatal error directly with the Exception can not be captured, which will affect the business operations, interrupt the business, from the point of view of the logging library on the exception handling, should not be directly converted to string Object.

"exception": "Error: Object of class CurlHandle could not be converted to string in /app/vendor/alibabacloud/aliyun-log-php-sdk/Aliyun/Log/requestcore.class.php:835\nStack trace:\n#0 /app/vendor/alibabacloud/aliyun-log-php-sdk/Aliyun/Log/Client.php(142): RequestCore->send_request()\n#1 /app/vendor/alibabacloud/aliyun-log-php-sdk/Aliyun/Log/Client.php(157):

It is suggested that when curl encounters a response of false, simply use only curl's own function to do something with the return handle, as in the submitted code change, and if there is a better way to do this feel free to point it out.

@CLAassistant
Copy link

CLAassistant commented Sep 27, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants