|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.openstreetmap.josm.io.OsmTransferException
org.openstreetmap.josm.io.OsmApiException
public class OsmApiException
Exception thrown when a communication error occurs when accessing the OSM API.
OsmApi
,
Serialized FormField Summary | |
---|---|
private java.lang.String |
accessedUrl
|
private java.lang.String |
errorBody
|
private java.lang.String |
errorHeader
|
private int |
responseCode
|
Constructor Summary | |
---|---|
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(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). |
Method Summary | |
---|---|
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. |
Methods inherited from class org.openstreetmap.josm.io.OsmTransferException |
---|
getUrl, setUrl |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int responseCode
private java.lang.String errorHeader
private java.lang.String errorBody
private java.lang.String accessedUrl
Constructor Detail |
---|
public OsmApiException(int responseCode, java.lang.String errorHeader, java.lang.String errorBody)
OsmApiException
with the specified response code, error header and error body
responseCode
- 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.Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |