
The metrics can be sent to a StatsD server, which may be specified via the wgStatsdServer configuration variable. $stats = $context -> getStats () $stats -> increment ( '' ) $stats -> timing ( '', $rtt ) If you need to share a debug log for diagnostic purposes, access the wiki without being logged in, and remove from the debug log any COOKIE lines, and don't capture any login attempt.Ĭreating a custom log file MediaWiki version: If this information is publicly accessible, attackers can use it to hack and compromise your machine and user account. The debug log file can contain private information such as login credentials, session cookies, and values of submitted forms. Some subsystems write to custom logs, see #Creating a custom log file to capture their output.ĭatabase transaction lifecycle debugging can be enabled for some databases with $wgDebugDBTransactions. This file will contain much debug information from MediaWiki core and extensions. */ $wgDebugLogFile = "/var/log/mediawiki/debug. * The filename is with the database name of the wiki. * But ensure that the directory is writeable by the PHP script running within your Web server. $e->getMessage()./** * The debug log file must never be publicly accessible because it contains private data. 'body' => "This is the body we're sending."Įcho $e->getCode(). this nifty little try/catch will save us pain when we encounter bad phone numbers $client = new Client($account_sid, $auth_token) These vars are your accountSid and authToken from /user/account
PHP TRY CATCH ECHO CONSOLE ERROR MESSAGE DOWNLOAD
Download the PHP helper library from /docs/php/install create a function to send SMS using copilot (uses an SID instead of a phone number) require_once './Twilio/autoload.php' // Loads the library not efficient when you're sending tens of thousands of text messages. We did some work-around a month or two ago which involved logging when a message was sent and had a cron job checking where we left off every two minutes. My use case is I had to send to a database of numbers and not have an invalid phone number break my script. You need to import Twilio\Exceptions\TwilioException for TwilioException to work.

TwilioException is not valid and neither is Services_Twilio_RestException. How can I get the twilio-errors catched and processed?

Services_Twilio_RestException in /path/to/my/laravel/vendor/twilio/sdk/Services/Twilio.php line 297Įxception_message: The 'To' number +15005550001 is not a valid phone number.įrom the documentation this error (not valid phone numer) shall be thrown, but I should have a possiblity to catch and process it. This results in the following error: Whoops, looks like something went wrong. Here is what I've done so far: getMessage( ), _FUNCTION_ ) // this is not called when an twilio error occurs The error seems to be in the twilio-sdk if I read the error message correctly.

I have problems when I want to implement an error-handling.įor some reason the catch does not get the error, which results in a crash of the app. Sending a valid request with test-credentials works fine. To use it in the framework I use aloha/laravel-twilio integration. I am implementing twilio in my laravel 5 application.
