{"record":{"id":"25c5ff62bf2ed95c","repo":"thephpleague/flysystem","slug":"copy-command-returned-unexpected-status-code","errorCode":null,"errorMessage":"COPY command returned unexpected status code: ","messagePattern":"COPY command returned unexpected status code: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/WebDAV/WebDAVAdapter.php","lineNumber":400,"sourceCode":"        }\n\n        if ($this->manualCopy) {\n            $this->manualCopy($source, $destination);\n\n            return;\n        }\n\n        $this->createParentDirFor($destination);\n        $location = $this->encodePath($this->prefixer->prefixPath($source));\n        $newLocation = $this->encodePath($this->prefixer->prefixPath($destination));\n\n        try {\n            $response = $this->client->request('COPY', $location, null, [\n                'Destination' => $this->client->getAbsoluteUrl($newLocation),\n            ]);\n\n            if ($response['statusCode'] < 200 || $response['statusCode'] >= 300) {\n                throw new RuntimeException('COPY command returned unexpected status code: ' . $response['statusCode']);\n            }\n        } catch (Throwable $e) {\n            throw UnableToCopyFile::fromLocationTo($source, $destination, $e);\n        }\n    }\n\n    private function manualCopy(string $source, string $destination): void\n    {\n        try {\n            $handle = $this->readStream($source);\n            $this->writeStream($destination, $handle, new Config());\n            @fclose($handle);\n        } catch (Throwable $exception) {\n            throw UnableToCopyFile::fromLocationTo($source, $destination, $exception);\n        }\n    }\n\n    private function propsIsDirectory(array $properties): bool","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/thephpleague/flysystem/blob/b277b5dc3d56650b68904117124e79c851e12376/src/WebDAV/WebDAVAdapter.php#L382-L418","documentation":"Error \"COPY command returned unexpected status code: \" thrown in thephpleague/flysystem.","triggerScenarios":"Thrown at src/WebDAV/WebDAVAdapter.php:400 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"}