Skip to content

Commit 6f23db1

Browse files
authored
Create RedException.php
1 parent 37026bd commit 6f23db1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/Red/Base/RedException.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/** Red Framework
3+
* Exception Base Class
4+
* @author REDCODER
5+
* http://redframework.ir
6+
*/
7+
8+
namespace Red\Base;
9+
10+
11+
class RedException extends \Exception
12+
{
13+
protected $exception_no = "Red Exception";
14+
15+
public function __construct($exception_no, $exception_message, $code = 0, \Exception $previous = null) {
16+
parent::__construct($exception_message, $code, $previous);
17+
$this->exception_no = $exception_no;
18+
}
19+
20+
21+
public function getExceptionNo()
22+
{
23+
return $this->exception_no;
24+
}
25+
26+
27+
public function __toString() {
28+
return __CLASS__ . " : [{$this->exception_no}] : {$this->message}\n";
29+
}
30+
}

0 commit comments

Comments
 (0)