Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
fd578207
Commit
fd578207
authored
Jan 07, 2015
by
Morris Jobke
Browse files
Merge pull request #13132 from aptivate/improve_debug_logging_messages
Improve debugging for ServiceUnavailable exceptions
parents
4628e98c
402a3ed1
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/private/connector/sabre/file.php
View file @
fd578207
...
...
@@ -56,12 +56,12 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
throw
new
\
Sabre\DAV\Exception\Forbidden
();
}
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
$e
->
getMessage
());
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"File is not updatable: "
.
$e
->
getMessage
());
}
// throw an exception if encryption was disabled but the files are still encrypted
if
(
\
OC_Util
::
encryptedFiles
())
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
();
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Encryption is disabled"
);
}
$fileName
=
basename
(
$this
->
path
);
...
...
@@ -107,7 +107,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
}
catch
(
\
OCA\Files_Encryption\Exception\EncryptionException
$e
)
{
throw
new
\
Sabre\DAV\Exception\Forbidden
(
$e
->
getMessage
());
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
$e
->
getMessage
());
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Failed to write file contents: "
.
$e
->
getMessage
());
}
try
{
...
...
@@ -147,7 +147,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
}
$this
->
refreshInfo
();
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
$e
->
getMessage
());
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Failed to check file size: "
.
$e
->
getMessage
());
}
return
'"'
.
$this
->
info
->
getEtag
()
.
'"'
;
...
...
@@ -162,14 +162,14 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
//throw exception if encryption is disabled but files are still encrypted
if
(
\
OC_Util
::
encryptedFiles
())
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
();
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Encryption is disabled"
);
}
else
{
try
{
return
$this
->
fileView
->
fopen
(
ltrim
(
$this
->
path
,
'/'
),
'rb'
);
}
catch
(
\
OCA\Files_Encryption\Exception\EncryptionException
$e
)
{
throw
new
\
Sabre\DAV\Exception\Forbidden
(
$e
->
getMessage
());
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
$e
->
getMessage
());
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Failed to open file: "
.
$e
->
getMessage
());
}
}
...
...
@@ -192,7 +192,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
throw
new
\
Sabre\DAV\Exception\Forbidden
();
}
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
$e
->
getMessage
());
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Failed to unlink: "
.
$e
->
getMessage
());
}
// remove properties
...
...
@@ -297,7 +297,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
$info
=
$this
->
fileView
->
getFileInfo
(
$targetPath
);
return
$info
->
getEtag
();
}
catch
(
\
OCP\Files\StorageNotAvailableException
$e
)
{
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
$e
->
getMessage
());
throw
new
\
Sabre\DAV\Exception\ServiceUnavailable
(
"Failed to put file: "
.
$e
->
getMessage
());
}
}
...
...
lib/private/files/storage/dav.php
View file @
fd578207
...
...
@@ -529,7 +529,7 @@ class DAV extends \OC\Files\Storage\Common {
}
catch
(
Exception\NotFound
$e
)
{
return
false
;
}
catch
(
Exception
$e
)
{
throw
new
StorageNotAvailableException
();
throw
new
StorageNotAvailableException
(
get_class
(
$e
)
.
": "
.
$e
->
getMessage
()
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment