Closed d-miles closed 2 years ago
Ha, as I was going through the rest of the documentation, I've just realized this page I was linked to (from "Handling Exceptions" on the main PHP reference page) seems to be somewhat out of date. While the link is for the 'usage guide,' the header of the page mentions that it is really a usage/migration guide to v5.x.
So, perhaps the only change necessary is either updating this PHP reference page to link elsewhere, or extracting the "Handling Exceptions" portions into their own documentation and applying the fixes I pointed out 😃
Thanks for the call out. The exception handling docs work for both 5.x and 6.x. I've submitted the changes for internal review.
The docs have been updated. Please let us know if we can help with anything else.
Issue Summary
Wasn't sure where to report an error in the documentation, and thought this might be a better place than through a support ticket? I was looking for a repository to perhaps send a pull request but couldn't find one.
The Exceptions area of the Usage Guide page has a bunch of instances of invalid PHP syntax being used and/or mismatched Twilio method names. This is perhaps due to them being either generated or copied from documentation for other language's libraries.
In the first/second (Twilio Client), and fourth (TwilioException) examples:
should be
$call = ...
The first/second (Twilio Client, and third (CurlClient) examples have the same error:
should be
$e->get_code();
-- though I'm not sure ifget_code()
is the correct method name either. If v4.x/v5.x exception classes are anything like v6.x exception classes, then this should also begetCode()
orgetMessage()
.TwimlException:
should be
$e->getCode();
or$e->getMessage();
TwilioException recommends catching
TwilioException
and calling$e->getStatusCode()
; this method is only available onRestException
though.Hope this helps improve your documentation! 😄