Noted inaccuracies of the is_error function for Response.
This commit is contained in:
parent
31f8c692b6
commit
decfd0b9bc
1 changed files with 4 additions and 0 deletions
|
@ -408,6 +408,10 @@ make_response! {
|
||||||
|
|
||||||
impl Response {
|
impl Response {
|
||||||
/// Determines whether or not this response is an error response.
|
/// Determines whether or not this response is an error response.
|
||||||
|
///
|
||||||
|
/// This error consideration is according to RFC2812, but is rather simplistic. It considers all
|
||||||
|
/// response codes above 400 to be errors, which misclassifies some extensions (e.g. from IRCv3)
|
||||||
|
/// that add responses and errors both in the same range (typically 700s or 900s).
|
||||||
pub fn is_error(&self) -> bool {
|
pub fn is_error(&self) -> bool {
|
||||||
*self as u16 >= 400
|
*self as u16 >= 400
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue