Skip to content

Commit a0e91e7

Browse files
committed
Use proper return codes for session errors
1 parent aab0b86 commit a0e91e7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/io/kamax/mxisd/exception/SessionNotValidatedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public class SessionNotValidatedException extends HttpMatrixException {
2626

2727
public SessionNotValidatedException() {
28-
super(HttpStatus.SC_OK, "M_SESSION_NOT_VALIDATED", "This validation session has not yet been completed");
28+
super(HttpStatus.SC_BAD_REQUEST, "M_SESSION_NOT_VALIDATED", "This validation session has not yet been completed");
2929
}
3030

3131
}

src/main/java/io/kamax/mxisd/exception/SessionUnknownException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020

2121
package io.kamax.mxisd.exception;
2222

23+
import org.apache.http.HttpStatus;
24+
2325
public class SessionUnknownException extends HttpMatrixException {
2426

2527
public SessionUnknownException() {
2628
this("No valid session was found matching that sid and client secret");
2729
}
2830

2931
public SessionUnknownException(String error) {
30-
super(200, "M_NO_VALID_SESSION", error);
32+
super(HttpStatus.SC_NOT_FOUND, "M_NO_VALID_SESSION", error);
3133
}
3234

3335
}

0 commit comments

Comments
 (0)