Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894328
PhutilProxyException.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhutilProxyException.php
View Options
<?php
/**
* Prior to PHP 5.3, PHP does not support nested exceptions; this class provides
* limited support for nested exceptions. Use methods on
* @{class:PhutilErrorHandler} to unnest exceptions in a forward-compatible way.
*
* @concrete-extensible
*/
class
PhutilProxyException
extends
Exception
{
private
$previousException
;
public
function
__construct
(
$message
,
$previous
,
$code
=
0
)
{
$this
->
previousException
=
$previous
;
// This may be an "Exception" or a "Throwable". The "__construct()" method
// for the Exception is documented as taking an Exception, not a Throwable.
// Although passing a Throwable appears to work in PHP 7.3, don't risk it.
$is_exception
=
(
$previous
instanceof
Exception
)
;
if
(
version_compare
(
PHP_VERSION
,
'5.3.0'
,
'>='
)
&&
$is_exception
)
{
parent
::
__construct
(
$message
,
$code
,
$previous
)
;
}
else
{
parent
::
__construct
(
$message
,
$code
)
;
}
}
public
function
getPreviousException
(
)
{
// NOTE: This can not be named "getPrevious()" because that method is final
// after PHP 5.3. Similarly, the property can not be named "previous"
// because HPHP declares a property with the same name and "protected"
// visibility.
return
$this
->
previousException
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 19:43 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1113833
Default Alt Text
PhutilProxyException.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment