function throw(string $className = ''): self {
    if (!is_callable($this->target)) throw new \BadMethodCallException('The function target is not callable.');

    $exception = null;
    try { call_user_func($this->target); }
    catch (\Throwable $e) { $exception = $e; }

    $constraint = logicalNot(isNull());
    return $this->expect($exception, mb_strlen($className) ? logicalAnd($constraint, isInstanceOf($className)) : $constraint);
  }