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

Debug switch? #14

Closed
vojtasvoboda opened this issue Jan 23, 2015 · 1 comment
Closed

Debug switch? #14

vojtasvoboda opened this issue Jan 23, 2015 · 1 comment

Comments

@vojtasvoboda
Copy link

Is there any debug switch, to see full answer from Graph API?

$fb = App::make('facebook-query-builder');
$fb->setAccessToken('CAAIt8ie86xwBALP1tdkYTSctlj9dBc...');
$user = $fb->search('Bill', 'user')->get();

I don't know whats wrong, because all requests returns same error "Graph returned an error response."

@SammyK
Copy link
Owner

SammyK commented Jan 25, 2015

Hey @vojtasvoboda!

In version 1.x of FQB, exceptions from the Facebook PHP SDK are re-thrown horizontally. So in your try/catch you'll need to make use of getPrevious() to access the exception thrown by the SDK. You can also use getResponse() to see the raw error response from Graph.

use SammyK\FacebookQueryBuilder\FacebookQueryBuilderException;

try {
    $user = $fb->search('Bill', 'user')->get();
} catch (FacebookQueryBuilderException $e) {
    echo $e->getPrevious()->getMessage();
    // A handy way to grab the response from Graph
    var_dump($e->getResponse());
    exit;
}

@SammyK SammyK closed this as completed Jan 28, 2015
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