Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893394
PhabricatorRateLimitRequestExceptionHandler.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
PhabricatorRateLimitRequestExceptionHandler.php
View Options
<?php
final
class
PhabricatorRateLimitRequestExceptionHandler
extends
PhabricatorRequestExceptionHandler
{
public
function
getRequestExceptionHandlerPriority
(
)
{
return
300000
;
}
public
function
getRequestExceptionHandlerDescription
(
)
{
return
pht
(
'Handles action rate limiting exceptions which occur when a user '
.
'does something too frequently.'
)
;
}
public
function
canHandleRequestException
(
AphrontRequest
$request
,
Exception
$ex
)
{
if
(
!
$this
->
isPhabricatorSite
(
$request
)
)
{
return
false
;
}
return
(
$ex
instanceof
PhabricatorSystemActionRateLimitException
)
;
}
public
function
handleRequestException
(
AphrontRequest
$request
,
Exception
$ex
)
{
$viewer
=
$this
->
getViewer
(
$request
)
;
return
id
(
new
AphrontDialogView
(
)
)
->
setTitle
(
pht
(
'Slow Down!'
)
)
->
setUser
(
$viewer
)
->
setErrors
(
array
(
pht
(
'You are being rate limited.'
)
)
)
->
appendParagraph
(
$ex
->
getMessage
(
)
)
->
appendParagraph
(
$ex
->
getRateExplanation
(
)
)
->
addCancelButton
(
'/'
,
pht
(
'Okaaaaaaaaaaaaaay...'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 18:19 (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127372
Default Alt Text
PhabricatorRateLimitRequestExceptionHandler.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment