{"record":{"id":"1562001828937611","repo":"thephpleague/flysystem","slug":"unexpected-status-code-received","errorCode":null,"errorMessage":"Unexpected status code received: ","messagePattern":"Unexpected status code received: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/WebDAV/WebDAVAdapter.php","lineNumber":133,"sourceCode":"    public function writeStream(string $path, $contents, Config $config): void\n    {\n        $this->upload($path, $contents);\n    }\n\n    /**\n     * @param resource|string $contents\n     */\n    private function upload(string $path, mixed $contents): void\n    {\n        $this->createParentDirFor($path);\n        $location = $this->encodePath($this->prefixer->prefixPath($path));\n\n        try {\n            $response = $this->client->request('PUT', $location, $contents);\n            $statusCode = $response['statusCode'];\n\n            if ($statusCode < 200 || $statusCode >= 300) {\n                throw new RuntimeException('Unexpected status code received: ' . $statusCode);\n            }\n        } catch (Throwable $exception) {\n            throw UnableToWriteFile::atLocation($path, $exception->getMessage(), $exception);\n        }\n    }\n\n    public function read(string $path): string\n    {\n        $location = $this->encodePath($this->prefixer->prefixPath($path));\n\n        try {\n            $response = $this->client->request('GET', $location);\n\n            if ($response['statusCode'] !== 200) {\n                throw new RuntimeException('Unexpected response code for GET: ' . $response['statusCode']);\n            }\n\n            return $response['body'];","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/thephpleague/flysystem/blob/b277b5dc3d56650b68904117124e79c851e12376/src/WebDAV/WebDAVAdapter.php#L115-L151","documentation":"Error \"Unexpected status code received: \" thrown in thephpleague/flysystem.","triggerScenarios":"Thrown at src/WebDAV/WebDAVAdapter.php:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b277b5dc3d56650b68904117124e79c851e12376","analyzedAt":"2026-08-17T04:28:35.741Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}