Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

markvdputten's avatar

Socialite - Catching Guzzle ClientException

Hi all,

Would anyone have an idea how to catch a Socialite / Guzzle 400 ClientException? My code currently looks like this, but it the catch part does not seem to take effect:

try {
    $user = Socialite::driver('facebook')->user();
} catch (GuzzleHttp\Exception\ClientException $e) {
    dd('Here');
}
dd( $user );

I am just stuck in the normal error screen reporting the error to me.

Thanks in advance for any guidance.

0 likes
3 replies
cyberomin's avatar

Hi @MvdP,

I had the same issue, your code looks right. You may need to add a backward slash to Guzzle

try {
    $user = Socialite::driver('facebook')->user();
} catch (\GuzzleHttp\Exception\ClientException $e) {
    dd('Here');
}
2 likes
absmendoza's avatar

Does anybody knows how to solve the Socialite / Guzzle 400 ClientException ?

Please or to participate in this conversation.