{"record":{"id":"de4163c6a1cf8378","repo":"guzzle/guzzle","slug":"guzzlehttp-handler-curlhandler-should-never-be-uns","errorCode":null,"errorMessage":"GuzzleHttp\\Handler\\CurlHandler should never be unserialized","messagePattern":"GuzzleHttp\\\\Handler\\\\CurlHandler should never be unserialized","errorType":"panic","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Handler/CurlHandler.php","lineNumber":130,"sourceCode":"    public function close(): void\n    {\n        $this->doClose(true);\n    }\n\n    public function __destruct()\n    {\n        try {\n            $this->doClose(false);\n        } catch (\\Throwable $e) {\n            // Destructors must not throw.\n        }\n    }\n\n    public function __unserialize(array $data): void\n    {\n        $this->closed = true;\n\n        throw new \\LogicException(static::class.' should never be unserialized');\n    }\n\n    private function assertOpen(): void\n    {\n        if ($this->closed) {\n            // Programmer misuse (reusing a closed handler), not a transfer failure;\n            // intentionally a LogicException outside the GuzzleException hierarchy.\n            throw new \\BadMethodCallException('Cannot use the cURL handler after it has been closed.');\n        }\n    }\n\n    private function doClose(bool $explicit): void\n    {\n        if ($this->closed) {\n            return;\n        }\n\n        $this->closed = true;","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/guzzle/guzzle/blob/d1cbca76970939a9c2ced55b1e25ea26f34fc773/src/Handler/CurlHandler.php#L112-L148","documentation":"Error \"GuzzleHttp\\Handler\\CurlHandler should never be unserialized\" thrown in guzzle/guzzle.","triggerScenarios":"Thrown at src/Handler/CurlHandler.php:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not serialize/unserialize CurlHandler; create a new instance with the same constructor options."],"exampleFix":"$handler = new CurlHandler(['max_handles' => 50]);","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d1cbca76970939a9c2ced55b1e25ea26f34fc773","analyzedAt":"2026-08-06T00:37:27.795Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}