FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
github-api/src/Github/exceptions.php at master · milo/github-api · GitHub
milo
/
github-api
Public
Notifications
You must be signed in to change notification settings
Fork
53
Star
92
Code
Issues
1
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
github-api
/
src
/
Github
/
exceptions.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
164 lines (120 loc) · 2.99 KB
Breadcrumbs
github-api
/
src
/
Github
/
exceptions.php
Copy path
File metadata and controls
164 lines (120 loc) · 2.99 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
declare
(strict_types=
1
);
/**
* All Milo\Github exceptions at one place. Whole library does not throw anything else.
*
* @author Miloslav Hůla (https://github.com/milo)
*/
namespace
Milo
\
Github
{
/**
* Marker interface.
*/
interface
IException
{}
/**
* Wrong algorithm. API is used in wrong way. Application code should be changed.
*/
class
LogicException
extends
\LogicException
implements
IException
{}
/**
* Substitution is used in URL path but corresponding parameter is missing.
*/
class
MissingParameterException
extends
LogicException
{}
/**
* Unpredictable situation occurred.
*/
abstract
class
RuntimeException
extends
\RuntimeException
implements
IException
{}
/**
* Github API returned a non-success HTTP code or data are somehow wrong. See all following descendants.
*
* @see Api::decode()
* @see https://developer.github.com/v3/#client-errors
*/
abstract
class
ApiException
extends
RuntimeException
{
private
?
Http
\
Response
$
response
;
public
function
__construct
(
string
$
message
=
''
,
int
$
code
=
0
, ?
\
Exception
$
previous
=
null
, ?
Http
\
Response
$
response
=
null
)
{
parent
::
__construct
(
$
message
,
$
code
,
$
previous
);
$
this
->
response
=
clone
$
response
;
}
final
public
function
getResponse
(): ?
Http
\
Response
{
return
$
this
->
response
;
}
}
/**
* Invalid credentials (e.g. revoked token).
*/
class
UnauthorizedException
extends
ApiException
{}
/**
* Invalid JSON sent to Github API.
*/
class
BadRequestException
extends
ApiException
{}
/**
* Invalid structure sent to Github API (e.g. some required fields are missing).
*/
class
UnprocessableEntityException
extends
ApiException
{}
/**
* Access denied.
* @see https://developer.github.com/v3/#authentication
*/
class
ForbiddenException
extends
ApiException
{}
/**
* Rate limit exceed.
* @see https://developer.github.com/v3/#rate-limiting
*/
class
RateLimitExceedException
extends
ForbiddenException
{}
/**
* Resource not found.
* @see https://developer.github.com/v3/#authentication
*/
class
NotFoundException
extends
ApiException
{}
/**
* Response cannot be classified.
*/
class
UnexpectedResponseException
extends
ApiException
{}
/**
* Response from Github is somehow wrong (e.g. invalid JSON decoding).
*/
class
InvalidResponseException
extends
ApiException
{}
/**
* JSON cannot be decoded, or value cannot be encoded to JSON.
*/
class
JsonException
extends
RuntimeException
{}
}
namespace
Milo
\
Github
\
Http
{
use
Milo
\
Github
;
/**
* HTTP response is somehow wrong and cannot be processed.
*/
class
BadResponseException
extends
Github
\RuntimeException
{}
}
namespace
Milo
\
Github
\
OAuth
{
use
Milo
\
Github
;
/**
* Something fails during the token obtaining.
*/
class
LoginException
extends
Github
\RuntimeException
{}
}
namespace
Milo
\
Github
\
Storages
{
use
Milo
\
Github
;
/**
* Directory is missing and/or cannot be created.
*/
class
MissingDirectoryException
extends
Github
\RuntimeException
{}
}
Back
|
FazBrowse Home
|
New Git URL