summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/exception/filelocked.php
blob: 6b6b7b0d856a1e4cd206b17340502d8d68382fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

namespace OC\Connector\Sabre\Exception;

use Exception;

class FileLocked extends \Sabre\DAV\Exception {

	public function __construct($message = "", $code = 0, Exception $previous = null) {
		if($previous instanceof \OCP\Files\LockNotAcquiredException) {
			$message = sprintf('Target file %s is locked by another process.', $previous->path);
		}
		parent::__construct($message, $code, $previous);
	}

	/**
	 * Returns the HTTP status code for this exception
	 *
	 * @return int
	 */
	public function getHTTPCode() {

		return 503;
	}
}