Skip to content

Instantly share code, notes, and snippets.

@danhstevens
Created December 4, 2014 03:18
Show Gist options
  • Save danhstevens/274b020e8213bb95b3bd to your computer and use it in GitHub Desktop.
Save danhstevens/274b020e8213bb95b3bd to your computer and use it in GitHub Desktop.
Kickbox - Catching an error with PHP
<?php
require_once 'vendor/autoload.php';
$client = new KickboxClient($api_key);
$kickbox = $client->kickbox();
try {
  $resp = $kickbox->verify($email);
  print_r($resp->body);
 }
catch (Exception $e) {
  echo "Code:" . $e->getCode() . "Message:" . $e->getMessage() . PHP_EOL;
//Code: 403 Message: Insufficient balance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment