| @@ 446-462 (lines=17) @@ | ||
| 443 | // validate JSON |
|
| 444 | if ($json === null) { |
|
| 445 | // should we provide debug information |
|
| 446 | if (self::DEBUG) { |
|
| 447 | // make it output proper |
|
| 448 | echo '<pre>'; |
|
| 449 | ||
| 450 | // dump the header-information |
|
| 451 | var_dump($headers); |
|
| 452 | ||
| 453 | // dump the error |
|
| 454 | var_dump($errorMessage); |
|
| 455 | ||
| 456 | // dump the raw response |
|
| 457 | var_dump($response); |
|
| 458 | ||
| 459 | // end proper format |
|
| 460 | echo '</pre>'; |
|
| 461 | } |
|
| 462 | ||
| 463 | // throw exception |
|
| 464 | throw new TwitterException('Invalid response.'); |
|
| 465 | } |
|
| @@ 470-486 (lines=17) @@ | ||
| 467 | // any errors |
|
| 468 | if (isset($json['errors'])) { |
|
| 469 | // should we provide debug information |
|
| 470 | if (self::DEBUG) { |
|
| 471 | // make it output proper |
|
| 472 | echo '<pre>'; |
|
| 473 | ||
| 474 | // dump the header-information |
|
| 475 | var_dump($headers); |
|
| 476 | ||
| 477 | // dump the error |
|
| 478 | var_dump($errorMessage); |
|
| 479 | ||
| 480 | // dump the raw response |
|
| 481 | var_dump($response); |
|
| 482 | ||
| 483 | // end proper format |
|
| 484 | echo '</pre>'; |
|
| 485 | } |
|
| 486 | ||
| 487 | // throw exception |
|
| 488 | if (isset($json['errors'][0]['message'])) { |
|
| 489 | throw new TwitterException($json['errors'][0]['message']); |
|