summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-02-05 16:23:22 +0100
committerRobin Appelman <icewind@owncloud.com>2016-02-08 14:07:58 +0100
commitb95e38852676580a93c2e538b303271905d037d3 (patch)
tree54ff82422a431c93fffbce6574958540812d75dd /lib/public
parent97b2e19c786e037acd99e31aabbf193c805617dd (diff)
downloadnextcloud-server-b95e38852676580a93c2e538b303271905d037d3.tar.gz
nextcloud-server-b95e38852676580a93c2e538b303271905d037d3.zip
Add occ command to verify storage configurations
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/files/storagenotavailableexception.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/public/files/storagenotavailableexception.php b/lib/public/files/storagenotavailableexception.php
index f9ac79d66ec..dd3915a2f6a 100644
--- a/lib/public/files/storagenotavailableexception.php
+++ b/lib/public/files/storagenotavailableexception.php
@@ -58,4 +58,30 @@ class StorageNotAvailableException extends HintException {
$l = \OC::$server->getL10N('core');
parent::__construct($message, $l->t('Storage not available'), $code, $previous);
}
+
+ /**
+ * Get the name for a status code
+ *
+ * @param int $code
+ * @return string
+ * @since 9.0.0
+ */
+ public static function getStateCodeName($code) {
+ switch ($code) {
+ case self::STATUS_SUCCESS:
+ return 'ok';
+ case self::STATUS_ERROR:
+ return 'error';
+ case self::STATUS_INDETERMINATE:
+ return 'indeterminate';
+ case self::STATUS_UNAUTHORIZED:
+ return 'unauthorized';
+ case self::STATUS_TIMEOUT:
+ return 'timeout';
+ case self::STATUS_NETWORK_ERROR:
+ return 'network error';
+ default:
+ return 'unknown';
+ }
+ }
}