source: extensions/instagram2piwigo/include/Instagram/Core/ApiException.php @ 19561

Last change on this file since 19561 was 19561, checked in by mistic100, 11 years ago

first commit

File size: 1.2 KB
Line 
1<?php
2
3/**
4* Instagram PHP
5* @author Galen Grover <galenjr@gmail.com>
6* @license http://opensource.org/licenses/mit-license.php The MIT License
7*/
8
9
10
11/**
12 * API Exception
13 *
14 * This exception type will be thrown for any API error
15 *
16 * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/index.php#L48}
17 */
18class Instagram_Core_ApiException extends Exception {
19
20    /**
21     * Invalid APU URI
22     */
23    const TYPE_NOT_ALLOWED  = 'APINotAllowedError';
24
25    /**
26     * Authorization error
27     */
28    const TYPE_OAUTH        = 'OAuthAccessTokenException';
29
30    /**
31     * Type of error
32     *
33     * @var string
34     */
35    protected $type;
36
37    /**
38     * Constructor
39     *
40     * @param string  $message Error message
41     * @param integer $code Error code
42     * @param string  $type Error type
43     * @param Exception $previous Previous exception
44     */
45    public function __construct( $message = null, $code = 0, $type = null, Exception $previous = null ) {
46        $this->type = $type;
47        parent::__construct( $message, $code, $previous );
48    }
49
50    /**
51     * Get error type
52     *
53     * @return string Get teh error type
54     */
55    public function getType() {
56        return $this->type;
57    }
58
59}
60?>
Note: See TracBrowser for help on using the repository browser.