HttpResponseException.java (httpcomponents-client-4.5.6-src) | : | HttpResponseException.java (httpcomponents-client-4.5.7-src) | ||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
* ==================================================================== | * ==================================================================== | |||
* | * | |||
* This software consists of voluntary contributions made by many | * This software consists of voluntary contributions made by many | |||
* individuals on behalf of the Apache Software Foundation. For more | * individuals on behalf of the Apache Software Foundation. For more | |||
* information on the Apache Software Foundation, please see | * information on the Apache Software Foundation, please see | |||
* <http://www.apache.org/>. | * <http://www.apache.org/>. | |||
* | * | |||
*/ | */ | |||
package org.apache.http.client; | package org.apache.http.client; | |||
import org.apache.http.util.TextUtils; | ||||
/** | /** | |||
* Signals a non 2xx HTTP response. | * Signals a non 2xx HTTP response. | |||
* | * | |||
* @since 4.0 | * @since 4.0 | |||
*/ | */ | |||
public class HttpResponseException extends ClientProtocolException { | public class HttpResponseException extends ClientProtocolException { | |||
private static final long serialVersionUID = -7186627969477257933L; | private static final long serialVersionUID = -7186627969477257933L; | |||
private final int statusCode; | private final int statusCode; | |||
private final String reasonPhrase; | ||||
public HttpResponseException(final int statusCode, final String s) { | public HttpResponseException(final int statusCode, final String reasonPhrase | |||
super(s); | ) { | |||
super(String.format("status code: %d" + | ||||
(TextUtils.isBlank(reasonPhrase) ? "" : ", reason phrase: %s"), | ||||
statusCode, reasonPhrase)); | ||||
this.statusCode = statusCode; | this.statusCode = statusCode; | |||
this.reasonPhrase = reasonPhrase; | ||||
} | } | |||
public int getStatusCode() { | public int getStatusCode() { | |||
return this.statusCode; | return this.statusCode; | |||
} | } | |||
public String getReasonPhrase() { | ||||
return this.reasonPhrase; | ||||
} | ||||
} | } | |||
End of changes. 5 change blocks. | ||||
2 lines changed or deleted | 13 lines changed or added |