Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError(code: 0): Argument 1 passed to Plivo\\Exceptions\\PlivoResponseException::__construct() must be of the type string or null, array given, called in vendor/plivo/plivo-php/src/Plivo/Resources/Endpoint/EndpointInterface.php on line 175 at vendor/plivo/plivo-php/src/Plivo/Exceptions/PlivoResponseException.php:32) #257

Open
mkhrystunov opened this issue Feb 2, 2022 · 1 comment

Comments

@mkhrystunov
Copy link

Library error format is inconsistent with PHP SDK

@haywiremk
Copy link

yes many lib files need the following change to get the errors back in my testing. This was the only way to get the issues to be returned in the exception. Sadly so many files need this change. For anyone testing this is how I worked around this issue.

throw new PlivoResponseException(
$responseContents['error'],
0,
null,
$response->getContent(),
$response->getStatusCode()

        );

changed to

throw new PlivoResponseException(
json_encode($responseContents['error']),
0,
null,
$response->getContent(),
$response->getStatusCode()

        );

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

No branches or pull requests

2 participants