Use proper return codes for session errors

This commit is contained in:
Max Dor
2019-01-30 00:28:55 +01:00
parent aab0b86646
commit a0e91e7896
2 changed files with 4 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ import org.apache.http.HttpStatus;
public class SessionNotValidatedException extends HttpMatrixException {
public SessionNotValidatedException() {
super(HttpStatus.SC_OK, "M_SESSION_NOT_VALIDATED", "This validation session has not yet been completed");
super(HttpStatus.SC_BAD_REQUEST, "M_SESSION_NOT_VALIDATED", "This validation session has not yet been completed");
}
}

View File

@@ -20,6 +20,8 @@
package io.kamax.mxisd.exception;
import org.apache.http.HttpStatus;
public class SessionUnknownException extends HttpMatrixException {
public SessionUnknownException() {
@@ -27,7 +29,7 @@ public class SessionUnknownException extends HttpMatrixException {
}
public SessionUnknownException(String error) {
super(200, "M_NO_VALID_SESSION", error);
super(HttpStatus.SC_NOT_FOUND, "M_NO_VALID_SESSION", error);
}
}