{"record":{"id":"a7ce1ea5bfa26185","repo":"symfony/process","slug":"unknown-timeout-type-d","errorCode":null,"errorMessage":"Unknown timeout type \"%d\".","messagePattern":"Unknown timeout type \"(.+?)\"\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"warning","filePath":"Exception/ProcessTimedOutException.php","lineNumber":57,"sourceCode":"        return $this->process;\n    }\n\n    public function isGeneralTimeout(): bool\n    {\n        return self::TYPE_GENERAL === $this->timeoutType;\n    }\n\n    public function isIdleTimeout(): bool\n    {\n        return self::TYPE_IDLE === $this->timeoutType;\n    }\n\n    public function getExceededTimeout(): ?float\n    {\n        return match ($this->timeoutType) {\n            self::TYPE_GENERAL => $this->process->getTimeout(),\n            self::TYPE_IDLE => $this->process->getIdleTimeout(),\n            default => throw new \\LogicException(\\sprintf('Unknown timeout type \"%d\".', $this->timeoutType)),\n        };\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":61,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/Exception/ProcessTimedOutException.php#L39-L61","documentation":"ProcessTimedOutException carries a timeoutType (TYPE_GENERAL or TYPE_IDLE). getExceededTimeout() maps the type to the process timeout or idle timeout; an unknown type means the exception's internal invariant was violated (type not set via the class constants), so a LogicException is thrown.","triggerScenarios":"Calling getExceededTimeout() on a ProcessTimedOutException whose $timeoutType constructor argument is neither TYPE_GENERAL nor TYPE_IDLE — normally only through manual construction of the exception or library-internal bugs.","commonSituations":"Manually instantiating ProcessTimedOutException with an arbitrary int, or catching the exception after a library version change that altered timeout type constants.","solutions":["Only construct ProcessTimedOutException via Process internals or with the class constants TYPE_GENERAL/TYPE_IDLE","Before reading, check isGeneralTimeout()/isIdleTimeout() and read the corresponding process timeout directly","Catch and inspect: wrap getExceededTimeout() in try/catch for LogicException and fall back to null"],"exampleFix":"// before\n$timeout = $e->getExceededTimeout();\n// after\n$timeout = $e->isGeneralTimeout() ? $process->getTimeout() : ($e->isIdleTimeout() ? $process->getIdleTimeout() : null);","handlingStrategy":"try-catch","validationCode":"$timeout = in_array($e->getTimeoutType(), [ProcessTimedOutException::TYPE_GENERAL, ProcessTimedOutException::TYPE_IDLE], true) ? $e->getExceededTimeout() : null;","typeGuard":null,"tryCatchPattern":"try { $timeout = $e->getExceededTimeout(); } catch (\\LogicException $e) { $timeout = null; }","preventionTips":["Only create ProcessTimedOutException with the class's TYPE_* constants","Prefer isGeneralTimeout()/isIdleTimeout() over raw type ints","Handle timeouts via Process::wait() exception flow rather than manual exception construction"],"tags":["timeout","process","logic-error","internal-state"],"backgroundTag":"internal-invariant-violation","analyzedSha":"99b85026db14a68f02c6f3eeb01a1170ca25c491","analyzedAt":"2026-09-14T11:23:33.683Z","contentChangedAt":"2026-09-14T11:23:33.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}