use GuzzleHttp\Exception\RequestException;
use Icewind\Streams\IteratorDirectory;
use Icewind\Streams\RetryWrapper;
+use OCP\Files\StorageNotAvailableException;
require_once __DIR__ . '/../../../3rdparty/Dropbox/autoload.php';
if ($list) {
try {
$response = $this->dropbox->getMetaData($path);
+ } catch (\Dropbox_Exception_Forbidden $e) {
+ throw new StorageNotAvailableException('Dropbox API rate limit exceeded', StorageNotAvailableException::STATUS_ERROR, $e);
} catch (\Exception $exception) {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
return false;
return $response;
}
return null;
+ } catch (\Dropbox_Exception_Forbidden $e) {
+ throw new StorageNotAvailableException('Dropbox API rate limit exceeded', StorageNotAvailableException::STATUS_ERROR, $e);
} catch (\Exception $exception) {
if ($exception instanceof \Dropbox_Exception_NotFound) {
// don't log, might be a file_exist check