External storage test: log exceptions
If an external storage test fails the exception's message is now written into the logfile (level INFO). Additionally, the stack trace is printed as DEBUG. This helps to resolve the reason for a failing connection. Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
This commit is contained in:
parent
ee77f37df2
commit
dc99442bc1
|
@ -449,8 +449,11 @@ abstract class Common implements Storage, ILockingStorage {
|
||||||
if ($this->stat('')) {
|
if ($this->stat('')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
\OC::$server->getLogger()->info("External storage not available: stat() failed");
|
||||||
return false;
|
return false;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
\OC::$server->getLogger()->info("External storage not available: " . $e->getMessage());
|
||||||
|
\OC::$server->getLogger()->logException($e, ['level' => \OCP\Util::DEBUG]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue