Skip to content

Commit 591db8b

Browse files
committed
Merge pull request #5 from Nekland/feature/new-exceptions
Added 2 new exception
2 parents 0aa89c5 + 10ac9ce commit 591db8b

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

Diff for: CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
1.0.0 (2014-09-XX)
1+
1.0.1 (2015-03-11)
2+
==================
3+
4+
* 2 new extensions to make easier error management
5+
6+
1.0.0 (2015-03-10)
27
==================
38

49
New awesome features
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/**
4+
* This file is a part of nekland base api package
5+
*
6+
* (c) Nekland <[email protected]>
7+
*
8+
* For the full license, take a look to the LICENSE file
9+
* on the root directory of this project
10+
*/
11+
12+
namespace Nekland\BaseApi\Exception;
13+
14+
15+
class AuthenticationException extends \Exception
16+
{
17+
public function __construct($message = null)
18+
{
19+
parent::__construct($message ?: 'The authentication to the API fails.');
20+
}
21+
}
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/**
4+
* This file is a part of nekland base api package
5+
*
6+
* (c) Nekland <[email protected]>
7+
*
8+
* For the full license, take a look to the LICENSE file
9+
* on the root directory of this project
10+
*/
11+
12+
namespace Nekland\BaseApi\Exception;
13+
14+
15+
class QuotaLimitException extends \Exception
16+
{
17+
/**
18+
* @var integer
19+
*/
20+
private $quota;
21+
22+
public function __construct($message = null)
23+
{
24+
parent::__construct($message ?: 'Your quota of queries is over.');
25+
}
26+
27+
/**
28+
* @param integer $quota
29+
*/
30+
public function setQuota($quota)
31+
{
32+
$this->quota = $quota;
33+
}
34+
35+
/**
36+
* @return integer int
37+
*/
38+
public function getQuota()
39+
{
40+
return $this->quota;
41+
}
42+
}

0 commit comments

Comments
 (0)