mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-03-30 20:08:46 +00:00
updated AuthenticationException to extend BaseServerResponseException
This commit is contained in:
parent
daa5ed6ea8
commit
1adfa2a246
hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server
@ -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…
x
Reference in New Issue
Block a user