-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDelegateException.php
58 lines (52 loc) · 1.22 KB
/
DelegateException.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
<?php
namespace WebStream\Exception;
/**
* ApplicationException
* @author Ryuichi TANAKA.
* @since 2014/05/05
* @version 0.4
*/
class DelegateException extends ApplicationException
{
/**
* @var bool ハンドリング可否
*/
private $isHandled;
/**
* @var \Exception 例外オブジェクト
*/
private $originException;
/**
* constructor
* @param \Exception $originException 例外オブジェクト
*/
public function __construct(\Exception $originException)
{
parent::__construct($originException->getMessage(), 500, $originException);
$this->originException = $originException;
$this->isHandled = false;
}
/**
* オリジナルの例外を返却する
* @return \Exception 例外オブジェクト
*/
public function getOriginException()
{
return $this->originException;
}
/**
* ハンドリング可否を返却する
* @return bool ハンドリング可否
*/
public function isHandled()
{
return $this->isHandled;
}
/**
* ハンドリングを許可する
*/
public function enableHandled()
{
$this->isHandled = true;
}
}