-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new RobotServerException to capture and preserve the details
of an error reponse from the server.
- Loading branch information
1 parent
176fd89
commit 369a075
Showing
3 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
org.eclipsecon.e4rover.common/tests/org/eclipsecon/e4rover/core/RobotServerException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.eclipsecon.e4rover.core; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.commons.httpclient.HttpStatus; | ||
import org.apache.commons.httpclient.URI; | ||
|
||
@SuppressWarnings("serial") | ||
public class RobotServerException extends IOException { | ||
protected int responseCode; | ||
protected URI uri; | ||
protected String message; | ||
|
||
public RobotServerException(int responseCode, URI uri, String message) { | ||
this.responseCode = responseCode; | ||
this.uri = uri; | ||
this.message = message; | ||
} | ||
|
||
public int getResponseCode() { | ||
return responseCode; | ||
} | ||
|
||
public URI getUri() { | ||
return uri; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public String toString() { | ||
return HttpStatus.getStatusText(responseCode) + " - " + uri | ||
+ " - " + message; | ||
} | ||
} |