Commit graph

14 commits

Author SHA1 Message Date
umherirrender
092cd8ee31 Fixed some @params documentation (tests)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Ic8aaf0a93796b97d0fa4617c1f86ff59f4b36131
2014-04-17 20:43:42 +02:00
Faidon Liambotis
acdfea8836 Set ThrottledError's response code to 429
ThrottledError currently returns a 503, which in turn results into
badly-written spambots occasionally flooding our 5xx logs and graphs.

There is no reason, however, for ThrottledError to return a 5xx in the
first place: it's a user-generated error (user hitting a rate limit and
being throttled), not a server error. 5xx error codes in general have
many other implications, such as frontend caches treating this as a
backend failure and potentially retrying the same request, so they are
unsuitable and undesirable for the ThrottledError exception.

RFC 6585 (April 2012, updates: 2616) has added a special 4xx code
specifically for rate-limiting, 429 Too Many Requests. As the
description of that code matches exactly what ThrottledError was meant
for, switch it to using 429 instead.

Note that there is a chance 429 might be mistreated and not showed by
older or badly-written user agents as it's fairly new and not part of
RFC 2616, the original HTTP/1.1 spec. However, the last paragraph of
section 6.1.1 of RFC 2616, specifically covers the issue of UAs &
unknown status codes: it dictates that applications MUST understand the
class of any status code and treat them as the "x00 status code of that
class" (here: 400), MUST NOT be cached, and "SHOULD present to the user
the entity returned with the response, since that entity is likely to
include human-readable information which will explain the unusual
status".

Change-Id: I46335a76096ec800ee8ce5471bacffd41d2dc4f6
2014-03-28 12:25:59 +02:00
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +00:00
Mwalker
28326b93bc Merge "Add tests exceptions" 2014-03-05 18:54:08 +00:00
Mwalker
0bc431e7ec Merge "Expand MWException tests" 2014-03-01 00:06:02 +00:00
addshore
4ea70270ae Expand MWException tests
Change-Id: Ia6d579eff66c949f6d4318d09afb143ed78f3ac1
2014-02-27 11:25:19 +01:00
addshore
9e975c4a24 Add tests exceptions
- ErrorPageError
- ReadOnlyError
- UserNotLoggedIn

Change-Id: I9d0088d38e26a6b77e371288f1fa72dbe481cf66
2014-02-27 01:07:03 +01:00
Mwalker
95cbaf35ca Merge "Add test for BadTitleError exception" 2014-02-26 02:52:36 +00:00
Mwalker
f9f8d26946 Merge "Add test for ThrottledError exception" 2014-02-26 02:50:23 +00:00
addshore
89f4c93086 Fix typo in MWExceptionHandlerTest
Change-Id: I9868155c05bc9ca708f72b0ede02d90612136db9
2014-02-25 22:37:40 +01:00
addshore
ceabf35c40 Add test for BadTitleError exception
Change-Id: Ib7c5b9f385aa3fc3e68c55927b0cd5adc82ac1d1
2014-02-25 22:35:48 +01:00
addshore
87aee66672 Add test for ThrottledError exception
Change-Id: Ia98d6c24ce56c6707a67498e26107250d427a3bf
2014-02-25 22:35:06 +01:00
addshore
7a56bf8168 Add scope to Exception class methods
Change-Id: I0097aa9a6d9c178c85706b90484f7a68d3ddbc8b
2014-02-24 21:21:09 +01:00
addshore
557af13086 Split Exception.php
Change-Id: I8273b342f8814887b65227457d0a461d7cd31e75
2014-02-24 21:17:59 +01:00