2014-05-24 17:18:24 +04:00
|
|
|
<?php
|
2015-02-26 13:37:37 +03:00
|
|
|
/**
|
|
|
|
* ownCloud
|
|
|
|
*
|
|
|
|
* @author Owen Winkler
|
|
|
|
* @copyright 2013 Owen Winkler <owen@owncloud.com>
|
|
|
|
*
|
|
|
|
*/
|
2015-02-12 14:29:01 +03:00
|
|
|
|
|
|
|
namespace OC\Connector\Sabre\Exception;
|
|
|
|
|
|
|
|
use Exception;
|
|
|
|
|
|
|
|
class FileLocked extends \Sabre\DAV\Exception {
|
2014-05-24 17:18:24 +04:00
|
|
|
|
|
|
|
public function __construct($message = "", $code = 0, Exception $previous = null) {
|
|
|
|
if($previous instanceof \OCP\Files\LockNotAcquiredException) {
|
2014-05-30 16:10:48 +04:00
|
|
|
$message = sprintf('Target file %s is locked by another process.', $previous->path);
|
2014-05-24 17:18:24 +04:00
|
|
|
}
|
|
|
|
parent::__construct($message, $code, $previous);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-05-27 22:59:48 +04:00
|
|
|
* Returns the HTTP status code for this exception
|
2014-05-24 17:18:24 +04:00
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getHTTPCode() {
|
|
|
|
|
|
|
|
return 503;
|
|
|
|
}
|
|
|
|
}
|