/var/www/hkosl.com/imusiccircle/paypal/lib/paypal-permissions-sdk-php-eef386c/samples/Error.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
<?php
function getDetailedExceptionMessage($ex) {
    if(
$ex instanceof PPConnectionException) {
        return 
"Error connecting to " $ex->getUrl();
    } else if(
$ex instanceof PPConfigurationException) {
        return 
"Error at $ex->getLine() in $ex->getFile()";
    } else if(
$ex instanceof PPInvalidCredentialException || $x instanceof PPMissingCredentialException) {
        return 
$ex->errorMessage();
    }
    return 
"";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
        <img src="https://devtools-paypal.com/image/bdg_payments_by_pp_2line.png"/>
    <br />
    <div id="wrapper">
        <h3>SDK Exception</h3>
        <?php if (isset($ex) && $ex instanceof Exception) {?>
        <table>
            <tr>
                <td>Type</td>
                <td><?php echo get_class($ex)?></td>
            </tr>
            <tr>
                <td>Message</td>
                <td><?php echo $ex->getMessage();?></td>
            </tr>
            <tr>
                <td>Detailed message</td>
                <td><?php echo getDetailedExceptionMessage($ex);?></td>
            </tr>
            <?php }?>
        </table>
        <br /> <a href="index.php">Home</a>
    </div>
</body>
</html>