You are here

class InvalidOauth2ClientException in OAuth2 Client 8.3

Same name and namespace in other branches
  1. 8.2 src/Exception/InvalidOauth2ClientException.php \Drupal\oauth2_client\Exception\InvalidOauth2ClientException

Exception thrown when trying to retrieve a non-existent OAuth2 Client.

Hierarchy

Expanded class hierarchy of InvalidOauth2ClientException

1 file declares its use of InvalidOauth2ClientException
Oauth2ClientServiceBase.php in src/Service/Oauth2ClientServiceBase.php

File

src/Exception/InvalidOauth2ClientException.php, line 8

Namespace

Drupal\oauth2_client\Exception
View source
class InvalidOauth2ClientException extends \Exception {

  /**
   * Constructs an InvalidOauth2ClientException object.
   *
   * @param string $invalidClientId
   *   The passed Oauth2 Client ID that was found to be invalid.
   * @param string $message
   *   The Exception message to throw.
   * @param int $code
   *   The Exception code.
   * @param \Throwable $previous
   *   The previous exception used for the exception chaining.
   */
  public function __construct($invalidClientId, $message = "", $code = 0, \Throwable $previous = NULL) {
    if ($message == "") {
      if (is_scalar($invalidClientId)) {
        $message = "The OAuth2 Client plugin '" . $invalidClientId . "' does not exist";
      }
      else {
        $message = 'An invalid value was passed for the OAuth2 Plugin ID';
      }
    }
    parent::__construct($message, $code, $previous);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
InvalidOauth2ClientException::__construct public function Constructs an InvalidOauth2ClientException object.