Return HTTP 429 when thumbnailing is throttled due to too many errors
Bug: T110109 Change-Id: I8af527661a041964690faae7566fb97e305e2b0f
This commit is contained in:
parent
859d6bf2bc
commit
8d52a21598
1 changed files with 3 additions and 0 deletions
|
|
@ -332,6 +332,9 @@ function wfStreamThumb( array $params ) {
|
|||
$errorCode = 500;
|
||||
if ( !$thumb ) {
|
||||
$errorMsg = $errorMsg ?: $msg->rawParams( 'File::transform() returned false' )->escaped();
|
||||
if ( $errorMsg instanceof MessageSpecifier && $errorMsg->getKey() === 'thumbnail_image-failure-limit' ) {
|
||||
$errorCode = 429;
|
||||
}
|
||||
} elseif ( $thumb->isError() ) {
|
||||
$errorMsg = $thumb->getHtmlMsg();
|
||||
} elseif ( !$thumb->hasFile() ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue