You are here

public function UserToDeveloperConversionException::__construct in Apigee Edge 8

UserToDeveloperConversionException constructor.

Parameters

\Drupal\user\UserInterface $user: User object.

string $message: The Exception message, available replacements: @user (email).

int|null $code: The Exception code, default is the user id.

\Throwable|null $previous: The previous throwable used for the exception chaining.

File

src/Exception/UserToDeveloperConversionException.php, line 49

Class

UserToDeveloperConversionException
Base exception class for user to developer conversion errors.

Namespace

Drupal\apigee_edge\Exception

Code

public function __construct(UserInterface $user, string $message = 'Unable to convert "@user" user to developer.', ?int $code = NULL, ?\Throwable $previous = NULL) {
  $this->user = $user;
  $message = strtr($message, [
    '@user' => $user
      ->getEmail(),
  ]);
  $code = $code ?? $user
    ->id();
  parent::__construct($message, $code, $previous);
}