Vonage / vonage-php-sdk-core

Vonage REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com/
Apache License 2.0
908 stars 181 forks source link

SMS sending freezes the execution if throttle occurs #311

Open codewahoo opened 2 years ago

codewahoo commented 2 years ago

Line 51 in src/SMS/Client.php calls PHP sleep function, which expects a timeout in seconds, whereas src/SMS/ExceptionErrorHandler.php throws a ThrottleException object with a timeout in milliseconds. Thus, the script freezes for xxx seconds instead of milliseconds.

manavo commented 1 year ago

Looking at src/SMS/ExceptionErrorHandler.php, it does seem like it's setting the timeout in seconds now. So this should be resolved?

https://github.com/Vonage/vonage-php-sdk-core/blob/main/src/SMS/ExceptionErrorHandler.php#L62