public class OsmApiException extends OsmTransferException
OsmApi
,
Serialized FormModifier and Type | Field and Description |
---|---|
private java.lang.String |
accessedUrl |
private java.lang.String |
errorBody |
private java.lang.String |
errorHeader |
private int |
responseCode |
Constructor and Description |
---|
OsmApiException(int responseCode,
java.lang.String errorHeader,
java.lang.String errorBody)
Constructs an
OsmApiException with the specified response code, error header and error body |
OsmApiException(int responseCode,
java.lang.String errorHeader,
java.lang.String errorBody,
java.lang.String accessedUrl)
Constructs an
OsmApiException with the specified response code, error header and error body |
OsmApiException(java.lang.String message)
Constructs an
OsmApiException with the specified detail message. |
OsmApiException(java.lang.String message,
java.lang.Throwable cause)
Constructs an
OsmApiException with the specified detail message and cause. |
OsmApiException(java.lang.Throwable cause)
Constructs an
OsmApiException with the specified cause and a detail message of
(cause==null ? null : cause.toString())
(which typically contains the class and detail message of cause). |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAccessedUrl()
Replies the complete URL accessed when this error occured.
|
java.lang.String |
getDisplayMessage()
Replies a message suitable to be displayed in a message dialog
|
java.lang.String |
getErrorBody()
Replies the error body.
|
java.lang.String |
getErrorHeader()
Replies the error header.
|
java.lang.String |
getMessage() |
int |
getResponseCode()
Replies the HTTP response code.
|
void |
setAccessedUrl(java.lang.String url)
Sets the complete URL accessed when this error occured.
|
void |
setErrorBody(java.lang.String errorBody)
Sets the error body.
|
void |
setErrorHeader(java.lang.String errorHeader)
Sets the error header.
|
void |
setResponseCode(int responseCode)
Sets the HTTP response code.
|
getUrl, setUrl
private int responseCode
private java.lang.String errorHeader
private java.lang.String errorBody
private java.lang.String accessedUrl
public OsmApiException(int responseCode, java.lang.String errorHeader, java.lang.String errorBody, java.lang.String accessedUrl)
OsmApiException
with the specified response code, error header and error bodyresponseCode
- The HTTP response code replied by the OSM server. See HttpURLConnection
for predefined HTTP response code valueserrorHeader
- The error header, as transmitted in the Error
field of the HTTP response headererrorBody
- The error body, as transmitted in the HTTP response bodyaccessedUrl
- The complete URL accessed when this error occuredpublic OsmApiException(int responseCode, java.lang.String errorHeader, java.lang.String errorBody)
OsmApiException
with the specified response code, error header and error bodyresponseCode
- The HTTP response code replied by the OSM server. See HttpURLConnection
for predefined HTTP response code valueserrorHeader
- The error header, as transmitted in the Error
field of the HTTP response headererrorBody
- The error body, as transmitted in the HTTP response bodypublic OsmApiException(java.lang.String message)
OsmApiException
with the specified detail message.
The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable)
.message
- The detail message (which is saved for later retrieval by the getMessage()
method)public OsmApiException(java.lang.Throwable cause)
OsmApiException
with the specified cause and a detail message of
(cause==null ? null : cause.toString())
(which typically contains the class and detail message of cause).cause
- the cause (which is saved for later retrieval by the Throwable.getCause()
method).
A null value is permitted, and indicates that the cause is nonexistent or unknown.public OsmApiException(java.lang.String message, java.lang.Throwable cause)
OsmApiException
with the specified detail message and cause.
Note that the detail message associated with cause
is not automatically incorporated
into this exception's detail message.
message
- The detail message (which is saved for later retrieval by the getMessage()
method)cause
- The cause (which is saved for later retrieval by the Throwable.getCause()
method).
A null value is permitted, and indicates that the cause is nonexistent or unknown.public int getResponseCode()
public void setResponseCode(int responseCode)
responseCode
- The HTTP response code replied by the OSM server. See HttpURLConnection
for predefined HTTP response code valuespublic java.lang.String getErrorHeader()
Error
field of the HTTP response headerpublic void setErrorHeader(java.lang.String errorHeader)
errorHeader
- the error header, as transmitted in the Error
field of the HTTP response headerpublic java.lang.String getErrorBody()
public void setErrorBody(java.lang.String errorBody)
errorBody
- The error body, as transmitted in the HTTP response bodypublic java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String getDisplayMessage()
public void setAccessedUrl(java.lang.String url)
OsmTransferException.setUrl(java.lang.String)
, which is generally only the base URL of the server.url
- the complete URL accessed when this error occured.public java.lang.String getAccessedUrl()
OsmTransferException.getUrl()
, which is generally only the base URL of the server.