diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-07-30 08:55:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-30 08:55:28 +0200 |
commit | a3bf8ac339f390a8a0331875d1b72e2e88f2e939 (patch) | |
tree | 0f8d91f685eb38c266c81c150af45f3c11c78886 /apps | |
parent | 135209f24e88b350f6749f32854e8abdcaca4097 (diff) | |
parent | 13fd89575d554f33813c22212469f228815a2377 (diff) | |
download | nextcloud-server-a3bf8ac339f390a8a0331875d1b72e2e88f2e939.tar.gz nextcloud-server-a3bf8ac339f390a8a0331875d1b72e2e88f2e939.zip |
Merge pull request #16593 from nextcloud/fix/noid/more-precise-error-message
More precise error message when expected filesize does not match
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/File.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index d336df98306..dd25b046bcf 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -225,7 +225,7 @@ class File extends Node implements IFile { if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { $expected = (int)$_SERVER['CONTENT_LENGTH']; if ($count !== $expected) { - throw new BadRequest('expected filesize ' . $expected . ' got ' . $count); + throw new BadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $count . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.'); } } @@ -490,8 +490,7 @@ class File extends Node implements IFile { $expected = (int)$_SERVER['CONTENT_LENGTH']; if ($bytesWritten !== $expected) { $chunk_handler->remove($info['index']); - throw new BadRequest( - 'expected filesize ' . $expected . ' got ' . $bytesWritten); + throw new BadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $bytesWritten . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.'); } } } |