Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProcessTimedOutException.php

class ProcessTimedOutException

Exception that is thrown when a process times out.

@author Johannes M. Schmitt <schmittjoh@gmail.com>

Hierarchy

  • class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
    • class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
      • class \Symfony\Component\Process\Exception\ProcessTimedOutException extends \Symfony\Component\Process\Exception\RuntimeException

Expanded class hierarchy of ProcessTimedOutException

2 files declare their use of ProcessTimedOutException
Application.php in vendor/composer/composer/src/Composer/Console/Application.php
Process.php in vendor/symfony/process/Process.php

File

vendor/symfony/process/Exception/ProcessTimedOutException.php, line 21

Namespace

Symfony\Component\Process\Exception
View source
class ProcessTimedOutException extends RuntimeException {
    public const TYPE_GENERAL = 1;
    public const TYPE_IDLE = 2;
    public function __construct(Process $process, int $timeoutType) {
        parent::__construct(\sprintf('The process "%s" exceeded the timeout of %s seconds.', $process->getCommandLine(), $this->getExceededTimeout()));
    }
    public function getProcess() : Process {
        return $this->process;
    }
    public function isGeneralTimeout() : bool {
        return self::TYPE_GENERAL === $this->timeoutType;
    }
    public function isIdleTimeout() : bool {
        return self::TYPE_IDLE === $this->timeoutType;
    }
    public function getExceededTimeout() : ?float {
        return match ($this->timeoutType) {    self::TYPE_GENERAL => $this->process
                ->getTimeout(),
            self::TYPE_IDLE => $this->process
                ->getIdleTimeout(),
            default => throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType)),
        
        };
    }

}

Members

Title Sort descending Modifiers Object type Summary
ProcessTimedOutException::getExceededTimeout public function
ProcessTimedOutException::getProcess public function
ProcessTimedOutException::isGeneralTimeout public function
ProcessTimedOutException::isIdleTimeout public function
ProcessTimedOutException::TYPE_GENERAL public constant
ProcessTimedOutException::TYPE_IDLE public constant
ProcessTimedOutException::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal