updated AuthenticationException to extend BaseServerResponseException
This commit is contained in:
parent
daa5ed6ea8
commit
1adfa2a246
|
@ -181,7 +181,7 @@ public abstract class RestfulServer extends HttpServlet {
|
|||
// resourceMethod.get
|
||||
|
||||
} catch (AuthenticationException e) {
|
||||
response.setStatus(401);
|
||||
response.setStatus(e.getStatusCode());
|
||||
response.getWriter().write(e.getMessage());
|
||||
}
|
||||
catch (BaseServerResponseException e) {
|
||||
|
|
|
@ -5,8 +5,19 @@ import javax.servlet.ServletException;
|
|||
/**
|
||||
* Created by dsotnikov on 3/10/2014.
|
||||
*/
|
||||
public class AuthenticationException extends ServletException {
|
||||
public class AuthenticationException extends BaseServerResponseException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AuthenticationException() {
|
||||
super(401, "Client unauthorized");
|
||||
}
|
||||
|
||||
public AuthenticationException(String theMessage) {
|
||||
super(401, theMessage);
|
||||
}
|
||||
|
||||
public AuthenticationException(int theStatusCode, String theMessage) {
|
||||
super(theStatusCode, theMessage);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue