ClientExceptionInterface is the standardized Exception and thus preferable.
GuzzleException extends that interface.
namespace wcf\action;
use GuzzleHttp\ClientInterface;
-use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
use ParagonIE\ConstantTime\Hex;
+use Psr\Http\Client\ClientExceptionInterface;
use wcf\system\exception\NamedUserException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\io\HttpFactory;
// access_token to invalidate 'code'.
//
// Validation is happening within the `finally` so that the StateValidationException
- // overwrites any GuzzleException (improving the error message).
+ // overwrites any HTTP exception (improving the error message).
if ($this->supportsState()) {
$this->validateState();
}
$exceptionID = \wcf\functions\exception\logThrowable($e);
$type = 'genericException';
- if ($e instanceof GuzzleException) {
+ if ($e instanceof ClientExceptionInterface) {
$type = 'httpError';
}
namespace wcf\action;
-use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
+use Psr\Http\Client\ClientExceptionInterface;
use wcf\data\user\User;
use wcf\form\RegisterForm;
use wcf\system\exception\NamedUserException;
}
}
$oauthUser["__email"] = $email;
- } catch (GuzzleException $e) {
+ } catch (ClientExceptionInterface $e) {
}
WCF::getSession()->register('__oauthUser', $oauthUser);
namespace wcf\data\user\avatar;
-use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Request;
+use Psr\Http\Client\ClientExceptionInterface;
use wcf\system\io\HttpFactory;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
if ($response->getStatusCode() === 200) {
return true;
}
- } catch (GuzzleException $e) {
+ } catch (ClientExceptionInterface $e) {
// Ignore exception, because we return false anyways.
}