-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathFailoverException.php
63 lines (56 loc) · 1.18 KB
/
FailoverException.php
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* ArangoDB PHP client: failover exception
*
* @package ArangoDBClient
* @author Jan Steemann
* @copyright Copyright 2018, ArangoDB GmbH, Cologne, Germany
*/
namespace ArangoDBClient;
/**
* Failover-Exception
*
* This exception type will be thrown internally when a failover happens
*
* @package ArangoDBClient
* @since 3.3
*/
class FailoverException extends Exception
{
/**
* New leader endpoint
*
* @param string
*/
private $_leader;
/**
* Return a string representation of the exception
*
* @return string - string representation
*/
public function __toString()
{
return __CLASS__ . ': ' . $this->getLeader();
}
/**
* Set the new leader endpoint
*
* @param string - the new leader endpoint
*
* @return void
*/
public function setLeader($leader)
{
$this->_leader = $leader;
}
/**
* Return the new leader endpoint
*
* @return string - new leader endpoint
*/
public function getLeader()
{
return $this->_leader;
}
}
class_alias(FailoverException::class, '\triagens\ArangoDb\FailoverException');